google-cloud-web_security_scanner-v1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +7 -0
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +169 -0
  4. data/LICENSE.md +203 -0
  5. data/README.md +75 -0
  6. data/lib/google-cloud-web_security_scanner-v1.rb +21 -0
  7. data/lib/google/cloud/web_security_scanner/v1.rb +35 -0
  8. data/lib/google/cloud/web_security_scanner/v1/version.rb +28 -0
  9. data/lib/google/cloud/web_security_scanner/v1/web_security_scanner.rb +50 -0
  10. data/lib/google/cloud/web_security_scanner/v1/web_security_scanner/client.rb +1393 -0
  11. data/lib/google/cloud/web_security_scanner/v1/web_security_scanner/credentials.rb +51 -0
  12. data/lib/google/cloud/websecurityscanner/v1/crawled_url_pb.rb +24 -0
  13. data/lib/google/cloud/websecurityscanner/v1/finding_addon_pb.rb +74 -0
  14. data/lib/google/cloud/websecurityscanner/v1/finding_pb.rb +49 -0
  15. data/lib/google/cloud/websecurityscanner/v1/finding_type_stats_pb.rb +23 -0
  16. data/lib/google/cloud/websecurityscanner/v1/scan_config_error_pb.rb +68 -0
  17. data/lib/google/cloud/websecurityscanner/v1/scan_config_pb.rb +88 -0
  18. data/lib/google/cloud/websecurityscanner/v1/scan_run_error_trace_pb.rb +35 -0
  19. data/lib/google/cloud/websecurityscanner/v1/scan_run_pb.rb +49 -0
  20. data/lib/google/cloud/websecurityscanner/v1/scan_run_warning_trace_pb.rb +30 -0
  21. data/lib/google/cloud/websecurityscanner/v1/web_security_scanner_pb.rb +114 -0
  22. data/lib/google/cloud/websecurityscanner/v1/web_security_scanner_services_pb.rb +72 -0
  23. data/proto_docs/README.md +4 -0
  24. data/proto_docs/google/api/field_behavior.rb +59 -0
  25. data/proto_docs/google/api/resource.rb +283 -0
  26. data/proto_docs/google/cloud/websecurityscanner/v1/crawled_url.rb +44 -0
  27. data/proto_docs/google/cloud/websecurityscanner/v1/finding.rb +114 -0
  28. data/proto_docs/google/cloud/websecurityscanner/v1/finding_addon.rb +169 -0
  29. data/proto_docs/google/cloud/websecurityscanner/v1/finding_type_stats.rb +39 -0
  30. data/proto_docs/google/cloud/websecurityscanner/v1/scan_config.rb +200 -0
  31. data/proto_docs/google/cloud/websecurityscanner/v1/scan_config_error.rb +191 -0
  32. data/proto_docs/google/cloud/websecurityscanner/v1/scan_run.rb +110 -0
  33. data/proto_docs/google/cloud/websecurityscanner/v1/scan_run_error_trace.rb +77 -0
  34. data/proto_docs/google/cloud/websecurityscanner/v1/scan_run_warning_trace.rb +62 -0
  35. data/proto_docs/google/cloud/websecurityscanner/v1/web_security_scanner.rb +278 -0
  36. data/proto_docs/google/protobuf/empty.rb +36 -0
  37. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  38. data/proto_docs/google/protobuf/timestamp.rb +120 -0
  39. metadata +220 -0
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ # This gem does not autoload during Bundler.require. To load this gem,
20
+ # issue explicit require statements for the packages desired, e.g.:
21
+ # require "google/cloud/web_security_scanner/v1"
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/web_security_scanner/v1/web_security_scanner"
20
+ require "google/cloud/web_security_scanner/v1/version"
21
+
22
+ module Google
23
+ module Cloud
24
+ module WebSecurityScanner
25
+ ##
26
+ # To load this package, including all its services, and instantiate a client:
27
+ #
28
+ # require "google/cloud/web_security_scanner/v1"
29
+ # client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new
30
+ #
31
+ module V1
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+
20
+ module Google
21
+ module Cloud
22
+ module WebSecurityScanner
23
+ module V1
24
+ VERSION = "0.1.0"
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "gapic/common"
20
+ require "gapic/config"
21
+ require "gapic/config/method"
22
+
23
+ require "google/cloud/web_security_scanner/v1/version"
24
+
25
+ require "google/cloud/web_security_scanner/v1/web_security_scanner/credentials"
26
+ require "google/cloud/web_security_scanner/v1/web_security_scanner/client"
27
+
28
+ module Google
29
+ module Cloud
30
+ module WebSecurityScanner
31
+ module V1
32
+ ##
33
+ # Web Security Scanner Service identifies security vulnerabilities in web
34
+ # applications hosted on Google Cloud. It crawls your application, and
35
+ # attempts to exercise as many user inputs and event handlers as possible.
36
+ #
37
+ # To load this service and instantiate a client:
38
+ #
39
+ # require "google/cloud/web_security_scanner/v1/web_security_scanner"
40
+ # client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new
41
+ #
42
+ module WebSecurityScanner
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
48
+
49
+ helper_path = ::File.join __dir__, "web_security_scanner", "helpers.rb"
50
+ require "google/cloud/web_security_scanner/v1/web_security_scanner/helpers" if ::File.file? helper_path
@@ -0,0 +1,1393 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/cloud/websecurityscanner/v1/web_security_scanner_pb"
21
+
22
+ module Google
23
+ module Cloud
24
+ module WebSecurityScanner
25
+ module V1
26
+ module WebSecurityScanner
27
+ ##
28
+ # Client for the WebSecurityScanner service.
29
+ #
30
+ # Web Security Scanner Service identifies security vulnerabilities in web
31
+ # applications hosted on Google Cloud. It crawls your application, and
32
+ # attempts to exercise as many user inputs and event handlers as possible.
33
+ #
34
+ class Client
35
+ # @private
36
+ attr_reader :web_security_scanner_stub
37
+
38
+ ##
39
+ # Configure the WebSecurityScanner Client class.
40
+ #
41
+ # See {::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client::Configuration}
42
+ # for a description of the configuration fields.
43
+ #
44
+ # ## Example
45
+ #
46
+ # To modify the configuration for all WebSecurityScanner clients:
47
+ #
48
+ # ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.configure do |config|
49
+ # config.timeout = 10.0
50
+ # end
51
+ #
52
+ # @yield [config] Configure the Client client.
53
+ # @yieldparam config [Client::Configuration]
54
+ #
55
+ # @return [Client::Configuration]
56
+ #
57
+ def self.configure
58
+ @configure ||= begin
59
+ namespace = ["Google", "Cloud", "WebSecurityScanner", "V1"]
60
+ parent_config = while namespace.any?
61
+ parent_name = namespace.join "::"
62
+ parent_const = const_get parent_name
63
+ break parent_const.configure if parent_const&.respond_to? :configure
64
+ namespace.pop
65
+ end
66
+ default_config = Client::Configuration.new parent_config
67
+
68
+ default_config.rpcs.create_scan_config.timeout = 600.0
69
+
70
+ default_config.rpcs.delete_scan_config.timeout = 600.0
71
+ default_config.rpcs.delete_scan_config.retry_policy = {
72
+ initial_delay: 0.1,
73
+ max_delay: 60.0,
74
+ multiplier: 1.3,
75
+ retry_codes: [4, 14]
76
+ }
77
+
78
+ default_config.rpcs.get_scan_config.timeout = 600.0
79
+ default_config.rpcs.get_scan_config.retry_policy = {
80
+ initial_delay: 0.1,
81
+ max_delay: 60.0,
82
+ multiplier: 1.3,
83
+ retry_codes: [4, 14]
84
+ }
85
+
86
+ default_config.rpcs.list_scan_configs.timeout = 600.0
87
+ default_config.rpcs.list_scan_configs.retry_policy = {
88
+ initial_delay: 0.1,
89
+ max_delay: 60.0,
90
+ multiplier: 1.3,
91
+ retry_codes: [4, 14]
92
+ }
93
+
94
+ default_config.rpcs.update_scan_config.timeout = 600.0
95
+
96
+ default_config.rpcs.start_scan_run.timeout = 600.0
97
+
98
+ default_config.rpcs.get_scan_run.timeout = 600.0
99
+ default_config.rpcs.get_scan_run.retry_policy = {
100
+ initial_delay: 0.1,
101
+ max_delay: 60.0,
102
+ multiplier: 1.3,
103
+ retry_codes: [4, 14]
104
+ }
105
+
106
+ default_config.rpcs.list_scan_runs.timeout = 600.0
107
+ default_config.rpcs.list_scan_runs.retry_policy = {
108
+ initial_delay: 0.1,
109
+ max_delay: 60.0,
110
+ multiplier: 1.3,
111
+ retry_codes: [4, 14]
112
+ }
113
+
114
+ default_config.rpcs.stop_scan_run.timeout = 600.0
115
+
116
+ default_config.rpcs.list_crawled_urls.timeout = 600.0
117
+ default_config.rpcs.list_crawled_urls.retry_policy = {
118
+ initial_delay: 0.1,
119
+ max_delay: 60.0,
120
+ multiplier: 1.3,
121
+ retry_codes: [4, 14]
122
+ }
123
+
124
+ default_config.rpcs.get_finding.timeout = 600.0
125
+ default_config.rpcs.get_finding.retry_policy = {
126
+ initial_delay: 0.1,
127
+ max_delay: 60.0,
128
+ multiplier: 1.3,
129
+ retry_codes: [4, 14]
130
+ }
131
+
132
+ default_config.rpcs.list_findings.timeout = 600.0
133
+ default_config.rpcs.list_findings.retry_policy = {
134
+ initial_delay: 0.1,
135
+ max_delay: 60.0,
136
+ multiplier: 1.3,
137
+ retry_codes: [4, 14]
138
+ }
139
+
140
+ default_config.rpcs.list_finding_type_stats.timeout = 600.0
141
+ default_config.rpcs.list_finding_type_stats.retry_policy = {
142
+ initial_delay: 0.1,
143
+ max_delay: 60.0,
144
+ multiplier: 1.3,
145
+ retry_codes: [4, 14]
146
+ }
147
+
148
+ default_config
149
+ end
150
+ yield @configure if block_given?
151
+ @configure
152
+ end
153
+
154
+ ##
155
+ # Configure the WebSecurityScanner Client instance.
156
+ #
157
+ # The configuration is set to the derived mode, meaning that values can be changed,
158
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
159
+ # should be made on {Client.configure}.
160
+ #
161
+ # See {::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client::Configuration}
162
+ # for a description of the configuration fields.
163
+ #
164
+ # @yield [config] Configure the Client client.
165
+ # @yieldparam config [Client::Configuration]
166
+ #
167
+ # @return [Client::Configuration]
168
+ #
169
+ def configure
170
+ yield @config if block_given?
171
+ @config
172
+ end
173
+
174
+ ##
175
+ # Create a new WebSecurityScanner client object.
176
+ #
177
+ # ## Examples
178
+ #
179
+ # To create a new WebSecurityScanner client with the default
180
+ # configuration:
181
+ #
182
+ # client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new
183
+ #
184
+ # To create a new WebSecurityScanner client with a custom
185
+ # configuration:
186
+ #
187
+ # client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new do |config|
188
+ # config.timeout = 10.0
189
+ # end
190
+ #
191
+ # @yield [config] Configure the WebSecurityScanner client.
192
+ # @yieldparam config [Client::Configuration]
193
+ #
194
+ def initialize
195
+ # These require statements are intentionally placed here to initialize
196
+ # the gRPC module only when it's required.
197
+ # See https://github.com/googleapis/toolkit/issues/446
198
+ require "gapic/grpc"
199
+ require "google/cloud/websecurityscanner/v1/web_security_scanner_services_pb"
200
+
201
+ # Create the configuration object
202
+ @config = Configuration.new Client.configure
203
+
204
+ # Yield the configuration if needed
205
+ yield @config if block_given?
206
+
207
+ # Create credentials
208
+ credentials = @config.credentials
209
+ credentials ||= Credentials.default scope: @config.scope
210
+ if credentials.is_a?(String) || credentials.is_a?(Hash)
211
+ credentials = Credentials.new credentials, scope: @config.scope
212
+ end
213
+ @quota_project_id = @config.quota_project
214
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
215
+
216
+ @web_security_scanner_stub = ::Gapic::ServiceStub.new(
217
+ ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Stub,
218
+ credentials: credentials,
219
+ endpoint: @config.endpoint,
220
+ channel_args: @config.channel_args,
221
+ interceptors: @config.interceptors
222
+ )
223
+ end
224
+
225
+ # Service calls
226
+
227
+ ##
228
+ # Creates a new ScanConfig.
229
+ #
230
+ # @overload create_scan_config(request, options = nil)
231
+ # Pass arguments to `create_scan_config` via a request object, either of type
232
+ # {::Google::Cloud::WebSecurityScanner::V1::CreateScanConfigRequest} or an equivalent Hash.
233
+ #
234
+ # @param request [::Google::Cloud::WebSecurityScanner::V1::CreateScanConfigRequest, ::Hash]
235
+ # A request object representing the call parameters. Required. To specify no
236
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
237
+ # @param options [::Gapic::CallOptions, ::Hash]
238
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
239
+ #
240
+ # @overload create_scan_config(parent: nil, scan_config: nil)
241
+ # Pass arguments to `create_scan_config` via keyword arguments. Note that at
242
+ # least one keyword argument is required. To specify no parameters, or to keep all
243
+ # the default parameter values, pass an empty Hash as a request object (see above).
244
+ #
245
+ # @param parent [::String]
246
+ # Required. The parent resource name where the scan is created, which should be a
247
+ # project resource name in the format 'projects/\\{projectId}'.
248
+ # @param scan_config [::Google::Cloud::WebSecurityScanner::V1::ScanConfig, ::Hash]
249
+ # Required. The ScanConfig to be created.
250
+ #
251
+ # @yield [response, operation] Access the result along with the RPC operation
252
+ # @yieldparam response [::Google::Cloud::WebSecurityScanner::V1::ScanConfig]
253
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
254
+ #
255
+ # @return [::Google::Cloud::WebSecurityScanner::V1::ScanConfig]
256
+ #
257
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
258
+ #
259
+ def create_scan_config request, options = nil
260
+ raise ::ArgumentError, "request must be provided" if request.nil?
261
+
262
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1::CreateScanConfigRequest
263
+
264
+ # Converts hash and nil to an options object
265
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
266
+
267
+ # Customize the options with defaults
268
+ metadata = @config.rpcs.create_scan_config.metadata.to_h
269
+
270
+ # Set x-goog-api-client and x-goog-user-project headers
271
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
272
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
273
+ gapic_version: ::Google::Cloud::WebSecurityScanner::V1::VERSION
274
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
275
+
276
+ header_params = {
277
+ "parent" => request.parent
278
+ }
279
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
280
+ metadata[:"x-goog-request-params"] ||= request_params_header
281
+
282
+ options.apply_defaults timeout: @config.rpcs.create_scan_config.timeout,
283
+ metadata: metadata,
284
+ retry_policy: @config.rpcs.create_scan_config.retry_policy
285
+ options.apply_defaults metadata: @config.metadata,
286
+ retry_policy: @config.retry_policy
287
+
288
+ @web_security_scanner_stub.call_rpc :create_scan_config, request, options: options do |response, operation|
289
+ yield response, operation if block_given?
290
+ return response
291
+ end
292
+ rescue ::GRPC::BadStatus => e
293
+ raise ::Google::Cloud::Error.from_error(e)
294
+ end
295
+
296
+ ##
297
+ # Deletes an existing ScanConfig and its child resources.
298
+ #
299
+ # @overload delete_scan_config(request, options = nil)
300
+ # Pass arguments to `delete_scan_config` via a request object, either of type
301
+ # {::Google::Cloud::WebSecurityScanner::V1::DeleteScanConfigRequest} or an equivalent Hash.
302
+ #
303
+ # @param request [::Google::Cloud::WebSecurityScanner::V1::DeleteScanConfigRequest, ::Hash]
304
+ # A request object representing the call parameters. Required. To specify no
305
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
306
+ # @param options [::Gapic::CallOptions, ::Hash]
307
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
308
+ #
309
+ # @overload delete_scan_config(name: nil)
310
+ # Pass arguments to `delete_scan_config` via keyword arguments. Note that at
311
+ # least one keyword argument is required. To specify no parameters, or to keep all
312
+ # the default parameter values, pass an empty Hash as a request object (see above).
313
+ #
314
+ # @param name [::String]
315
+ # Required. The resource name of the ScanConfig to be deleted. The name follows the
316
+ # format of 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}'.
317
+ #
318
+ # @yield [response, operation] Access the result along with the RPC operation
319
+ # @yieldparam response [::Google::Protobuf::Empty]
320
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
321
+ #
322
+ # @return [::Google::Protobuf::Empty]
323
+ #
324
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
325
+ #
326
+ def delete_scan_config request, options = nil
327
+ raise ::ArgumentError, "request must be provided" if request.nil?
328
+
329
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1::DeleteScanConfigRequest
330
+
331
+ # Converts hash and nil to an options object
332
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
333
+
334
+ # Customize the options with defaults
335
+ metadata = @config.rpcs.delete_scan_config.metadata.to_h
336
+
337
+ # Set x-goog-api-client and x-goog-user-project headers
338
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
339
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
340
+ gapic_version: ::Google::Cloud::WebSecurityScanner::V1::VERSION
341
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
342
+
343
+ header_params = {
344
+ "name" => request.name
345
+ }
346
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
347
+ metadata[:"x-goog-request-params"] ||= request_params_header
348
+
349
+ options.apply_defaults timeout: @config.rpcs.delete_scan_config.timeout,
350
+ metadata: metadata,
351
+ retry_policy: @config.rpcs.delete_scan_config.retry_policy
352
+ options.apply_defaults metadata: @config.metadata,
353
+ retry_policy: @config.retry_policy
354
+
355
+ @web_security_scanner_stub.call_rpc :delete_scan_config, request, options: options do |response, operation|
356
+ yield response, operation if block_given?
357
+ return response
358
+ end
359
+ rescue ::GRPC::BadStatus => e
360
+ raise ::Google::Cloud::Error.from_error(e)
361
+ end
362
+
363
+ ##
364
+ # Gets a ScanConfig.
365
+ #
366
+ # @overload get_scan_config(request, options = nil)
367
+ # Pass arguments to `get_scan_config` via a request object, either of type
368
+ # {::Google::Cloud::WebSecurityScanner::V1::GetScanConfigRequest} or an equivalent Hash.
369
+ #
370
+ # @param request [::Google::Cloud::WebSecurityScanner::V1::GetScanConfigRequest, ::Hash]
371
+ # A request object representing the call parameters. Required. To specify no
372
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
373
+ # @param options [::Gapic::CallOptions, ::Hash]
374
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
375
+ #
376
+ # @overload get_scan_config(name: nil)
377
+ # Pass arguments to `get_scan_config` via keyword arguments. Note that at
378
+ # least one keyword argument is required. To specify no parameters, or to keep all
379
+ # the default parameter values, pass an empty Hash as a request object (see above).
380
+ #
381
+ # @param name [::String]
382
+ # Required. The resource name of the ScanConfig to be returned. The name follows the
383
+ # format of 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}'.
384
+ #
385
+ # @yield [response, operation] Access the result along with the RPC operation
386
+ # @yieldparam response [::Google::Cloud::WebSecurityScanner::V1::ScanConfig]
387
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
388
+ #
389
+ # @return [::Google::Cloud::WebSecurityScanner::V1::ScanConfig]
390
+ #
391
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
392
+ #
393
+ def get_scan_config request, options = nil
394
+ raise ::ArgumentError, "request must be provided" if request.nil?
395
+
396
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1::GetScanConfigRequest
397
+
398
+ # Converts hash and nil to an options object
399
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
400
+
401
+ # Customize the options with defaults
402
+ metadata = @config.rpcs.get_scan_config.metadata.to_h
403
+
404
+ # Set x-goog-api-client and x-goog-user-project headers
405
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
406
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
407
+ gapic_version: ::Google::Cloud::WebSecurityScanner::V1::VERSION
408
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
409
+
410
+ header_params = {
411
+ "name" => request.name
412
+ }
413
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
414
+ metadata[:"x-goog-request-params"] ||= request_params_header
415
+
416
+ options.apply_defaults timeout: @config.rpcs.get_scan_config.timeout,
417
+ metadata: metadata,
418
+ retry_policy: @config.rpcs.get_scan_config.retry_policy
419
+ options.apply_defaults metadata: @config.metadata,
420
+ retry_policy: @config.retry_policy
421
+
422
+ @web_security_scanner_stub.call_rpc :get_scan_config, request, options: options do |response, operation|
423
+ yield response, operation if block_given?
424
+ return response
425
+ end
426
+ rescue ::GRPC::BadStatus => e
427
+ raise ::Google::Cloud::Error.from_error(e)
428
+ end
429
+
430
+ ##
431
+ # Lists ScanConfigs under a given project.
432
+ #
433
+ # @overload list_scan_configs(request, options = nil)
434
+ # Pass arguments to `list_scan_configs` via a request object, either of type
435
+ # {::Google::Cloud::WebSecurityScanner::V1::ListScanConfigsRequest} or an equivalent Hash.
436
+ #
437
+ # @param request [::Google::Cloud::WebSecurityScanner::V1::ListScanConfigsRequest, ::Hash]
438
+ # A request object representing the call parameters. Required. To specify no
439
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
440
+ # @param options [::Gapic::CallOptions, ::Hash]
441
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
442
+ #
443
+ # @overload list_scan_configs(parent: nil, page_token: nil, page_size: nil)
444
+ # Pass arguments to `list_scan_configs` via keyword arguments. Note that at
445
+ # least one keyword argument is required. To specify no parameters, or to keep all
446
+ # the default parameter values, pass an empty Hash as a request object (see above).
447
+ #
448
+ # @param parent [::String]
449
+ # Required. The parent resource name, which should be a project resource name in the
450
+ # format 'projects/\\{projectId}'.
451
+ # @param page_token [::String]
452
+ # A token identifying a page of results to be returned. This should be a
453
+ # `next_page_token` value returned from a previous List request.
454
+ # If unspecified, the first page of results is returned.
455
+ # @param page_size [::Integer]
456
+ # The maximum number of ScanConfigs to return, can be limited by server.
457
+ # If not specified or not positive, the implementation will select a
458
+ # reasonable value.
459
+ #
460
+ # @yield [response, operation] Access the result along with the RPC operation
461
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1::ScanConfig>]
462
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
463
+ #
464
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1::ScanConfig>]
465
+ #
466
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
467
+ #
468
+ def list_scan_configs request, options = nil
469
+ raise ::ArgumentError, "request must be provided" if request.nil?
470
+
471
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1::ListScanConfigsRequest
472
+
473
+ # Converts hash and nil to an options object
474
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
475
+
476
+ # Customize the options with defaults
477
+ metadata = @config.rpcs.list_scan_configs.metadata.to_h
478
+
479
+ # Set x-goog-api-client and x-goog-user-project headers
480
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
481
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
482
+ gapic_version: ::Google::Cloud::WebSecurityScanner::V1::VERSION
483
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
484
+
485
+ header_params = {
486
+ "parent" => request.parent
487
+ }
488
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
489
+ metadata[:"x-goog-request-params"] ||= request_params_header
490
+
491
+ options.apply_defaults timeout: @config.rpcs.list_scan_configs.timeout,
492
+ metadata: metadata,
493
+ retry_policy: @config.rpcs.list_scan_configs.retry_policy
494
+ options.apply_defaults metadata: @config.metadata,
495
+ retry_policy: @config.retry_policy
496
+
497
+ @web_security_scanner_stub.call_rpc :list_scan_configs, request, options: options do |response, operation|
498
+ response = ::Gapic::PagedEnumerable.new @web_security_scanner_stub, :list_scan_configs, request, response, operation, options
499
+ yield response, operation if block_given?
500
+ return response
501
+ end
502
+ rescue ::GRPC::BadStatus => e
503
+ raise ::Google::Cloud::Error.from_error(e)
504
+ end
505
+
506
+ ##
507
+ # Updates a ScanConfig. This method support partial update of a ScanConfig.
508
+ #
509
+ # @overload update_scan_config(request, options = nil)
510
+ # Pass arguments to `update_scan_config` via a request object, either of type
511
+ # {::Google::Cloud::WebSecurityScanner::V1::UpdateScanConfigRequest} or an equivalent Hash.
512
+ #
513
+ # @param request [::Google::Cloud::WebSecurityScanner::V1::UpdateScanConfigRequest, ::Hash]
514
+ # A request object representing the call parameters. Required. To specify no
515
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
516
+ # @param options [::Gapic::CallOptions, ::Hash]
517
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
518
+ #
519
+ # @overload update_scan_config(scan_config: nil, update_mask: nil)
520
+ # Pass arguments to `update_scan_config` via keyword arguments. Note that at
521
+ # least one keyword argument is required. To specify no parameters, or to keep all
522
+ # the default parameter values, pass an empty Hash as a request object (see above).
523
+ #
524
+ # @param scan_config [::Google::Cloud::WebSecurityScanner::V1::ScanConfig, ::Hash]
525
+ # Required. The ScanConfig to be updated. The name field must be set to identify the
526
+ # resource to be updated. The values of fields not covered by the mask
527
+ # will be ignored.
528
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
529
+ # Required. The update mask applies to the resource. For the `FieldMask` definition,
530
+ # see
531
+ # https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
532
+ #
533
+ # @yield [response, operation] Access the result along with the RPC operation
534
+ # @yieldparam response [::Google::Cloud::WebSecurityScanner::V1::ScanConfig]
535
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
536
+ #
537
+ # @return [::Google::Cloud::WebSecurityScanner::V1::ScanConfig]
538
+ #
539
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
540
+ #
541
+ def update_scan_config request, options = nil
542
+ raise ::ArgumentError, "request must be provided" if request.nil?
543
+
544
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1::UpdateScanConfigRequest
545
+
546
+ # Converts hash and nil to an options object
547
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
548
+
549
+ # Customize the options with defaults
550
+ metadata = @config.rpcs.update_scan_config.metadata.to_h
551
+
552
+ # Set x-goog-api-client and x-goog-user-project headers
553
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
554
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
555
+ gapic_version: ::Google::Cloud::WebSecurityScanner::V1::VERSION
556
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
557
+
558
+ header_params = {
559
+ "scan_config.name" => request.scan_config.name
560
+ }
561
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
562
+ metadata[:"x-goog-request-params"] ||= request_params_header
563
+
564
+ options.apply_defaults timeout: @config.rpcs.update_scan_config.timeout,
565
+ metadata: metadata,
566
+ retry_policy: @config.rpcs.update_scan_config.retry_policy
567
+ options.apply_defaults metadata: @config.metadata,
568
+ retry_policy: @config.retry_policy
569
+
570
+ @web_security_scanner_stub.call_rpc :update_scan_config, request, options: options do |response, operation|
571
+ yield response, operation if block_given?
572
+ return response
573
+ end
574
+ rescue ::GRPC::BadStatus => e
575
+ raise ::Google::Cloud::Error.from_error(e)
576
+ end
577
+
578
+ ##
579
+ # Start a ScanRun according to the given ScanConfig.
580
+ #
581
+ # @overload start_scan_run(request, options = nil)
582
+ # Pass arguments to `start_scan_run` via a request object, either of type
583
+ # {::Google::Cloud::WebSecurityScanner::V1::StartScanRunRequest} or an equivalent Hash.
584
+ #
585
+ # @param request [::Google::Cloud::WebSecurityScanner::V1::StartScanRunRequest, ::Hash]
586
+ # A request object representing the call parameters. Required. To specify no
587
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
588
+ # @param options [::Gapic::CallOptions, ::Hash]
589
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
590
+ #
591
+ # @overload start_scan_run(name: nil)
592
+ # Pass arguments to `start_scan_run` via keyword arguments. Note that at
593
+ # least one keyword argument is required. To specify no parameters, or to keep all
594
+ # the default parameter values, pass an empty Hash as a request object (see above).
595
+ #
596
+ # @param name [::String]
597
+ # Required. The resource name of the ScanConfig to be used. The name follows the
598
+ # format of 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}'.
599
+ #
600
+ # @yield [response, operation] Access the result along with the RPC operation
601
+ # @yieldparam response [::Google::Cloud::WebSecurityScanner::V1::ScanRun]
602
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
603
+ #
604
+ # @return [::Google::Cloud::WebSecurityScanner::V1::ScanRun]
605
+ #
606
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
607
+ #
608
+ def start_scan_run request, options = nil
609
+ raise ::ArgumentError, "request must be provided" if request.nil?
610
+
611
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1::StartScanRunRequest
612
+
613
+ # Converts hash and nil to an options object
614
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
615
+
616
+ # Customize the options with defaults
617
+ metadata = @config.rpcs.start_scan_run.metadata.to_h
618
+
619
+ # Set x-goog-api-client and x-goog-user-project headers
620
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
621
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
622
+ gapic_version: ::Google::Cloud::WebSecurityScanner::V1::VERSION
623
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
624
+
625
+ header_params = {
626
+ "name" => request.name
627
+ }
628
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
629
+ metadata[:"x-goog-request-params"] ||= request_params_header
630
+
631
+ options.apply_defaults timeout: @config.rpcs.start_scan_run.timeout,
632
+ metadata: metadata,
633
+ retry_policy: @config.rpcs.start_scan_run.retry_policy
634
+ options.apply_defaults metadata: @config.metadata,
635
+ retry_policy: @config.retry_policy
636
+
637
+ @web_security_scanner_stub.call_rpc :start_scan_run, request, options: options do |response, operation|
638
+ yield response, operation if block_given?
639
+ return response
640
+ end
641
+ rescue ::GRPC::BadStatus => e
642
+ raise ::Google::Cloud::Error.from_error(e)
643
+ end
644
+
645
+ ##
646
+ # Gets a ScanRun.
647
+ #
648
+ # @overload get_scan_run(request, options = nil)
649
+ # Pass arguments to `get_scan_run` via a request object, either of type
650
+ # {::Google::Cloud::WebSecurityScanner::V1::GetScanRunRequest} or an equivalent Hash.
651
+ #
652
+ # @param request [::Google::Cloud::WebSecurityScanner::V1::GetScanRunRequest, ::Hash]
653
+ # A request object representing the call parameters. Required. To specify no
654
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
655
+ # @param options [::Gapic::CallOptions, ::Hash]
656
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
657
+ #
658
+ # @overload get_scan_run(name: nil)
659
+ # Pass arguments to `get_scan_run` via keyword arguments. Note that at
660
+ # least one keyword argument is required. To specify no parameters, or to keep all
661
+ # the default parameter values, pass an empty Hash as a request object (see above).
662
+ #
663
+ # @param name [::String]
664
+ # Required. The resource name of the ScanRun to be returned. The name follows the
665
+ # format of
666
+ # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'.
667
+ #
668
+ # @yield [response, operation] Access the result along with the RPC operation
669
+ # @yieldparam response [::Google::Cloud::WebSecurityScanner::V1::ScanRun]
670
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
671
+ #
672
+ # @return [::Google::Cloud::WebSecurityScanner::V1::ScanRun]
673
+ #
674
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
675
+ #
676
+ def get_scan_run request, options = nil
677
+ raise ::ArgumentError, "request must be provided" if request.nil?
678
+
679
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1::GetScanRunRequest
680
+
681
+ # Converts hash and nil to an options object
682
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
683
+
684
+ # Customize the options with defaults
685
+ metadata = @config.rpcs.get_scan_run.metadata.to_h
686
+
687
+ # Set x-goog-api-client and x-goog-user-project headers
688
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
689
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
690
+ gapic_version: ::Google::Cloud::WebSecurityScanner::V1::VERSION
691
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
692
+
693
+ header_params = {
694
+ "name" => request.name
695
+ }
696
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
697
+ metadata[:"x-goog-request-params"] ||= request_params_header
698
+
699
+ options.apply_defaults timeout: @config.rpcs.get_scan_run.timeout,
700
+ metadata: metadata,
701
+ retry_policy: @config.rpcs.get_scan_run.retry_policy
702
+ options.apply_defaults metadata: @config.metadata,
703
+ retry_policy: @config.retry_policy
704
+
705
+ @web_security_scanner_stub.call_rpc :get_scan_run, request, options: options do |response, operation|
706
+ yield response, operation if block_given?
707
+ return response
708
+ end
709
+ rescue ::GRPC::BadStatus => e
710
+ raise ::Google::Cloud::Error.from_error(e)
711
+ end
712
+
713
+ ##
714
+ # Lists ScanRuns under a given ScanConfig, in descending order of ScanRun
715
+ # stop time.
716
+ #
717
+ # @overload list_scan_runs(request, options = nil)
718
+ # Pass arguments to `list_scan_runs` via a request object, either of type
719
+ # {::Google::Cloud::WebSecurityScanner::V1::ListScanRunsRequest} or an equivalent Hash.
720
+ #
721
+ # @param request [::Google::Cloud::WebSecurityScanner::V1::ListScanRunsRequest, ::Hash]
722
+ # A request object representing the call parameters. Required. To specify no
723
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
724
+ # @param options [::Gapic::CallOptions, ::Hash]
725
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
726
+ #
727
+ # @overload list_scan_runs(parent: nil, page_token: nil, page_size: nil)
728
+ # Pass arguments to `list_scan_runs` via keyword arguments. Note that at
729
+ # least one keyword argument is required. To specify no parameters, or to keep all
730
+ # the default parameter values, pass an empty Hash as a request object (see above).
731
+ #
732
+ # @param parent [::String]
733
+ # Required. The parent resource name, which should be a scan resource name in the
734
+ # format 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}'.
735
+ # @param page_token [::String]
736
+ # A token identifying a page of results to be returned. This should be a
737
+ # `next_page_token` value returned from a previous List request.
738
+ # If unspecified, the first page of results is returned.
739
+ # @param page_size [::Integer]
740
+ # The maximum number of ScanRuns to return, can be limited by server.
741
+ # If not specified or not positive, the implementation will select a
742
+ # reasonable value.
743
+ #
744
+ # @yield [response, operation] Access the result along with the RPC operation
745
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1::ScanRun>]
746
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
747
+ #
748
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1::ScanRun>]
749
+ #
750
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
751
+ #
752
+ def list_scan_runs request, options = nil
753
+ raise ::ArgumentError, "request must be provided" if request.nil?
754
+
755
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1::ListScanRunsRequest
756
+
757
+ # Converts hash and nil to an options object
758
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
759
+
760
+ # Customize the options with defaults
761
+ metadata = @config.rpcs.list_scan_runs.metadata.to_h
762
+
763
+ # Set x-goog-api-client and x-goog-user-project headers
764
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
765
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
766
+ gapic_version: ::Google::Cloud::WebSecurityScanner::V1::VERSION
767
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
768
+
769
+ header_params = {
770
+ "parent" => request.parent
771
+ }
772
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
773
+ metadata[:"x-goog-request-params"] ||= request_params_header
774
+
775
+ options.apply_defaults timeout: @config.rpcs.list_scan_runs.timeout,
776
+ metadata: metadata,
777
+ retry_policy: @config.rpcs.list_scan_runs.retry_policy
778
+ options.apply_defaults metadata: @config.metadata,
779
+ retry_policy: @config.retry_policy
780
+
781
+ @web_security_scanner_stub.call_rpc :list_scan_runs, request, options: options do |response, operation|
782
+ response = ::Gapic::PagedEnumerable.new @web_security_scanner_stub, :list_scan_runs, request, response, operation, options
783
+ yield response, operation if block_given?
784
+ return response
785
+ end
786
+ rescue ::GRPC::BadStatus => e
787
+ raise ::Google::Cloud::Error.from_error(e)
788
+ end
789
+
790
+ ##
791
+ # Stops a ScanRun. The stopped ScanRun is returned.
792
+ #
793
+ # @overload stop_scan_run(request, options = nil)
794
+ # Pass arguments to `stop_scan_run` via a request object, either of type
795
+ # {::Google::Cloud::WebSecurityScanner::V1::StopScanRunRequest} or an equivalent Hash.
796
+ #
797
+ # @param request [::Google::Cloud::WebSecurityScanner::V1::StopScanRunRequest, ::Hash]
798
+ # A request object representing the call parameters. Required. To specify no
799
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
800
+ # @param options [::Gapic::CallOptions, ::Hash]
801
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
802
+ #
803
+ # @overload stop_scan_run(name: nil)
804
+ # Pass arguments to `stop_scan_run` via keyword arguments. Note that at
805
+ # least one keyword argument is required. To specify no parameters, or to keep all
806
+ # the default parameter values, pass an empty Hash as a request object (see above).
807
+ #
808
+ # @param name [::String]
809
+ # Required. The resource name of the ScanRun to be stopped. The name follows the
810
+ # format of
811
+ # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'.
812
+ #
813
+ # @yield [response, operation] Access the result along with the RPC operation
814
+ # @yieldparam response [::Google::Cloud::WebSecurityScanner::V1::ScanRun]
815
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
816
+ #
817
+ # @return [::Google::Cloud::WebSecurityScanner::V1::ScanRun]
818
+ #
819
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
820
+ #
821
+ def stop_scan_run request, options = nil
822
+ raise ::ArgumentError, "request must be provided" if request.nil?
823
+
824
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1::StopScanRunRequest
825
+
826
+ # Converts hash and nil to an options object
827
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
828
+
829
+ # Customize the options with defaults
830
+ metadata = @config.rpcs.stop_scan_run.metadata.to_h
831
+
832
+ # Set x-goog-api-client and x-goog-user-project headers
833
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
834
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
835
+ gapic_version: ::Google::Cloud::WebSecurityScanner::V1::VERSION
836
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
837
+
838
+ header_params = {
839
+ "name" => request.name
840
+ }
841
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
842
+ metadata[:"x-goog-request-params"] ||= request_params_header
843
+
844
+ options.apply_defaults timeout: @config.rpcs.stop_scan_run.timeout,
845
+ metadata: metadata,
846
+ retry_policy: @config.rpcs.stop_scan_run.retry_policy
847
+ options.apply_defaults metadata: @config.metadata,
848
+ retry_policy: @config.retry_policy
849
+
850
+ @web_security_scanner_stub.call_rpc :stop_scan_run, request, options: options do |response, operation|
851
+ yield response, operation if block_given?
852
+ return response
853
+ end
854
+ rescue ::GRPC::BadStatus => e
855
+ raise ::Google::Cloud::Error.from_error(e)
856
+ end
857
+
858
+ ##
859
+ # List CrawledUrls under a given ScanRun.
860
+ #
861
+ # @overload list_crawled_urls(request, options = nil)
862
+ # Pass arguments to `list_crawled_urls` via a request object, either of type
863
+ # {::Google::Cloud::WebSecurityScanner::V1::ListCrawledUrlsRequest} or an equivalent Hash.
864
+ #
865
+ # @param request [::Google::Cloud::WebSecurityScanner::V1::ListCrawledUrlsRequest, ::Hash]
866
+ # A request object representing the call parameters. Required. To specify no
867
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
868
+ # @param options [::Gapic::CallOptions, ::Hash]
869
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
870
+ #
871
+ # @overload list_crawled_urls(parent: nil, page_token: nil, page_size: nil)
872
+ # Pass arguments to `list_crawled_urls` via keyword arguments. Note that at
873
+ # least one keyword argument is required. To specify no parameters, or to keep all
874
+ # the default parameter values, pass an empty Hash as a request object (see above).
875
+ #
876
+ # @param parent [::String]
877
+ # Required. The parent resource name, which should be a scan run resource name in the
878
+ # format
879
+ # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'.
880
+ # @param page_token [::String]
881
+ # A token identifying a page of results to be returned. This should be a
882
+ # `next_page_token` value returned from a previous List request.
883
+ # If unspecified, the first page of results is returned.
884
+ # @param page_size [::Integer]
885
+ # The maximum number of CrawledUrls to return, can be limited by server.
886
+ # If not specified or not positive, the implementation will select a
887
+ # reasonable value.
888
+ #
889
+ # @yield [response, operation] Access the result along with the RPC operation
890
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1::CrawledUrl>]
891
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
892
+ #
893
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1::CrawledUrl>]
894
+ #
895
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
896
+ #
897
+ def list_crawled_urls request, options = nil
898
+ raise ::ArgumentError, "request must be provided" if request.nil?
899
+
900
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1::ListCrawledUrlsRequest
901
+
902
+ # Converts hash and nil to an options object
903
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
904
+
905
+ # Customize the options with defaults
906
+ metadata = @config.rpcs.list_crawled_urls.metadata.to_h
907
+
908
+ # Set x-goog-api-client and x-goog-user-project headers
909
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
910
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
911
+ gapic_version: ::Google::Cloud::WebSecurityScanner::V1::VERSION
912
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
913
+
914
+ header_params = {
915
+ "parent" => request.parent
916
+ }
917
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
918
+ metadata[:"x-goog-request-params"] ||= request_params_header
919
+
920
+ options.apply_defaults timeout: @config.rpcs.list_crawled_urls.timeout,
921
+ metadata: metadata,
922
+ retry_policy: @config.rpcs.list_crawled_urls.retry_policy
923
+ options.apply_defaults metadata: @config.metadata,
924
+ retry_policy: @config.retry_policy
925
+
926
+ @web_security_scanner_stub.call_rpc :list_crawled_urls, request, options: options do |response, operation|
927
+ response = ::Gapic::PagedEnumerable.new @web_security_scanner_stub, :list_crawled_urls, request, response, operation, options
928
+ yield response, operation if block_given?
929
+ return response
930
+ end
931
+ rescue ::GRPC::BadStatus => e
932
+ raise ::Google::Cloud::Error.from_error(e)
933
+ end
934
+
935
+ ##
936
+ # Gets a Finding.
937
+ #
938
+ # @overload get_finding(request, options = nil)
939
+ # Pass arguments to `get_finding` via a request object, either of type
940
+ # {::Google::Cloud::WebSecurityScanner::V1::GetFindingRequest} or an equivalent Hash.
941
+ #
942
+ # @param request [::Google::Cloud::WebSecurityScanner::V1::GetFindingRequest, ::Hash]
943
+ # A request object representing the call parameters. Required. To specify no
944
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
945
+ # @param options [::Gapic::CallOptions, ::Hash]
946
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
947
+ #
948
+ # @overload get_finding(name: nil)
949
+ # Pass arguments to `get_finding` via keyword arguments. Note that at
950
+ # least one keyword argument is required. To specify no parameters, or to keep all
951
+ # the default parameter values, pass an empty Hash as a request object (see above).
952
+ #
953
+ # @param name [::String]
954
+ # Required. The resource name of the Finding to be returned. The name follows the
955
+ # format of
956
+ # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}/findings/\\{findingId}'.
957
+ #
958
+ # @yield [response, operation] Access the result along with the RPC operation
959
+ # @yieldparam response [::Google::Cloud::WebSecurityScanner::V1::Finding]
960
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
961
+ #
962
+ # @return [::Google::Cloud::WebSecurityScanner::V1::Finding]
963
+ #
964
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
965
+ #
966
+ def get_finding request, options = nil
967
+ raise ::ArgumentError, "request must be provided" if request.nil?
968
+
969
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1::GetFindingRequest
970
+
971
+ # Converts hash and nil to an options object
972
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
973
+
974
+ # Customize the options with defaults
975
+ metadata = @config.rpcs.get_finding.metadata.to_h
976
+
977
+ # Set x-goog-api-client and x-goog-user-project headers
978
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
979
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
980
+ gapic_version: ::Google::Cloud::WebSecurityScanner::V1::VERSION
981
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
982
+
983
+ header_params = {
984
+ "name" => request.name
985
+ }
986
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
987
+ metadata[:"x-goog-request-params"] ||= request_params_header
988
+
989
+ options.apply_defaults timeout: @config.rpcs.get_finding.timeout,
990
+ metadata: metadata,
991
+ retry_policy: @config.rpcs.get_finding.retry_policy
992
+ options.apply_defaults metadata: @config.metadata,
993
+ retry_policy: @config.retry_policy
994
+
995
+ @web_security_scanner_stub.call_rpc :get_finding, request, options: options do |response, operation|
996
+ yield response, operation if block_given?
997
+ return response
998
+ end
999
+ rescue ::GRPC::BadStatus => e
1000
+ raise ::Google::Cloud::Error.from_error(e)
1001
+ end
1002
+
1003
+ ##
1004
+ # List Findings under a given ScanRun.
1005
+ #
1006
+ # @overload list_findings(request, options = nil)
1007
+ # Pass arguments to `list_findings` via a request object, either of type
1008
+ # {::Google::Cloud::WebSecurityScanner::V1::ListFindingsRequest} or an equivalent Hash.
1009
+ #
1010
+ # @param request [::Google::Cloud::WebSecurityScanner::V1::ListFindingsRequest, ::Hash]
1011
+ # A request object representing the call parameters. Required. To specify no
1012
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1013
+ # @param options [::Gapic::CallOptions, ::Hash]
1014
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1015
+ #
1016
+ # @overload list_findings(parent: nil, filter: nil, page_token: nil, page_size: nil)
1017
+ # Pass arguments to `list_findings` via keyword arguments. Note that at
1018
+ # least one keyword argument is required. To specify no parameters, or to keep all
1019
+ # the default parameter values, pass an empty Hash as a request object (see above).
1020
+ #
1021
+ # @param parent [::String]
1022
+ # Required. The parent resource name, which should be a scan run resource name in the
1023
+ # format
1024
+ # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'.
1025
+ # @param filter [::String]
1026
+ # The filter expression. The expression must be in the format: <field>
1027
+ # <operator> <value>.
1028
+ # Supported field: 'finding_type'.
1029
+ # Supported operator: '='.
1030
+ # @param page_token [::String]
1031
+ # A token identifying a page of results to be returned. This should be a
1032
+ # `next_page_token` value returned from a previous List request.
1033
+ # If unspecified, the first page of results is returned.
1034
+ # @param page_size [::Integer]
1035
+ # The maximum number of Findings to return, can be limited by server.
1036
+ # If not specified or not positive, the implementation will select a
1037
+ # reasonable value.
1038
+ #
1039
+ # @yield [response, operation] Access the result along with the RPC operation
1040
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1::Finding>]
1041
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1042
+ #
1043
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1::Finding>]
1044
+ #
1045
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1046
+ #
1047
+ def list_findings request, options = nil
1048
+ raise ::ArgumentError, "request must be provided" if request.nil?
1049
+
1050
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1::ListFindingsRequest
1051
+
1052
+ # Converts hash and nil to an options object
1053
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1054
+
1055
+ # Customize the options with defaults
1056
+ metadata = @config.rpcs.list_findings.metadata.to_h
1057
+
1058
+ # Set x-goog-api-client and x-goog-user-project headers
1059
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1060
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1061
+ gapic_version: ::Google::Cloud::WebSecurityScanner::V1::VERSION
1062
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1063
+
1064
+ header_params = {
1065
+ "parent" => request.parent
1066
+ }
1067
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1068
+ metadata[:"x-goog-request-params"] ||= request_params_header
1069
+
1070
+ options.apply_defaults timeout: @config.rpcs.list_findings.timeout,
1071
+ metadata: metadata,
1072
+ retry_policy: @config.rpcs.list_findings.retry_policy
1073
+ options.apply_defaults metadata: @config.metadata,
1074
+ retry_policy: @config.retry_policy
1075
+
1076
+ @web_security_scanner_stub.call_rpc :list_findings, request, options: options do |response, operation|
1077
+ response = ::Gapic::PagedEnumerable.new @web_security_scanner_stub, :list_findings, request, response, operation, options
1078
+ yield response, operation if block_given?
1079
+ return response
1080
+ end
1081
+ rescue ::GRPC::BadStatus => e
1082
+ raise ::Google::Cloud::Error.from_error(e)
1083
+ end
1084
+
1085
+ ##
1086
+ # List all FindingTypeStats under a given ScanRun.
1087
+ #
1088
+ # @overload list_finding_type_stats(request, options = nil)
1089
+ # Pass arguments to `list_finding_type_stats` via a request object, either of type
1090
+ # {::Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsRequest} or an equivalent Hash.
1091
+ #
1092
+ # @param request [::Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsRequest, ::Hash]
1093
+ # A request object representing the call parameters. Required. To specify no
1094
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1095
+ # @param options [::Gapic::CallOptions, ::Hash]
1096
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1097
+ #
1098
+ # @overload list_finding_type_stats(parent: nil)
1099
+ # Pass arguments to `list_finding_type_stats` via keyword arguments. Note that at
1100
+ # least one keyword argument is required. To specify no parameters, or to keep all
1101
+ # the default parameter values, pass an empty Hash as a request object (see above).
1102
+ #
1103
+ # @param parent [::String]
1104
+ # Required. The parent resource name, which should be a scan run resource name in the
1105
+ # format
1106
+ # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'.
1107
+ #
1108
+ # @yield [response, operation] Access the result along with the RPC operation
1109
+ # @yieldparam response [::Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsResponse]
1110
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1111
+ #
1112
+ # @return [::Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsResponse]
1113
+ #
1114
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1115
+ #
1116
+ def list_finding_type_stats request, options = nil
1117
+ raise ::ArgumentError, "request must be provided" if request.nil?
1118
+
1119
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsRequest
1120
+
1121
+ # Converts hash and nil to an options object
1122
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1123
+
1124
+ # Customize the options with defaults
1125
+ metadata = @config.rpcs.list_finding_type_stats.metadata.to_h
1126
+
1127
+ # Set x-goog-api-client and x-goog-user-project headers
1128
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1129
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1130
+ gapic_version: ::Google::Cloud::WebSecurityScanner::V1::VERSION
1131
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1132
+
1133
+ header_params = {
1134
+ "parent" => request.parent
1135
+ }
1136
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1137
+ metadata[:"x-goog-request-params"] ||= request_params_header
1138
+
1139
+ options.apply_defaults timeout: @config.rpcs.list_finding_type_stats.timeout,
1140
+ metadata: metadata,
1141
+ retry_policy: @config.rpcs.list_finding_type_stats.retry_policy
1142
+ options.apply_defaults metadata: @config.metadata,
1143
+ retry_policy: @config.retry_policy
1144
+
1145
+ @web_security_scanner_stub.call_rpc :list_finding_type_stats, request, options: options do |response, operation|
1146
+ yield response, operation if block_given?
1147
+ return response
1148
+ end
1149
+ rescue ::GRPC::BadStatus => e
1150
+ raise ::Google::Cloud::Error.from_error(e)
1151
+ end
1152
+
1153
+ ##
1154
+ # Configuration class for the WebSecurityScanner API.
1155
+ #
1156
+ # This class represents the configuration for WebSecurityScanner,
1157
+ # providing control over timeouts, retry behavior, logging, transport
1158
+ # parameters, and other low-level controls. Certain parameters can also be
1159
+ # applied individually to specific RPCs. See
1160
+ # {::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client::Configuration::Rpcs}
1161
+ # for a list of RPCs that can be configured independently.
1162
+ #
1163
+ # Configuration can be applied globally to all clients, or to a single client
1164
+ # on construction.
1165
+ #
1166
+ # # Examples
1167
+ #
1168
+ # To modify the global config, setting the timeout for create_scan_config
1169
+ # to 20 seconds, and all remaining timeouts to 10 seconds:
1170
+ #
1171
+ # ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.configure do |config|
1172
+ # config.timeout = 10.0
1173
+ # config.rpcs.create_scan_config.timeout = 20.0
1174
+ # end
1175
+ #
1176
+ # To apply the above configuration only to a new client:
1177
+ #
1178
+ # client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new do |config|
1179
+ # config.timeout = 10.0
1180
+ # config.rpcs.create_scan_config.timeout = 20.0
1181
+ # end
1182
+ #
1183
+ # @!attribute [rw] endpoint
1184
+ # The hostname or hostname:port of the service endpoint.
1185
+ # Defaults to `"websecurityscanner.googleapis.com"`.
1186
+ # @return [::String]
1187
+ # @!attribute [rw] credentials
1188
+ # Credentials to send with calls. You may provide any of the following types:
1189
+ # * (`String`) The path to a service account key file in JSON format
1190
+ # * (`Hash`) A service account key as a Hash
1191
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
1192
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
1193
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1194
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
1195
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
1196
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
1197
+ # * (`nil`) indicating no credentials
1198
+ # @return [::Object]
1199
+ # @!attribute [rw] scope
1200
+ # The OAuth scopes
1201
+ # @return [::Array<::String>]
1202
+ # @!attribute [rw] lib_name
1203
+ # The library name as recorded in instrumentation and logging
1204
+ # @return [::String]
1205
+ # @!attribute [rw] lib_version
1206
+ # The library version as recorded in instrumentation and logging
1207
+ # @return [::String]
1208
+ # @!attribute [rw] channel_args
1209
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
1210
+ # `GRPC::Core::Channel` object is provided as the credential.
1211
+ # @return [::Hash]
1212
+ # @!attribute [rw] interceptors
1213
+ # An array of interceptors that are run before calls are executed.
1214
+ # @return [::Array<::GRPC::ClientInterceptor>]
1215
+ # @!attribute [rw] timeout
1216
+ # The call timeout in seconds.
1217
+ # @return [::Numeric]
1218
+ # @!attribute [rw] metadata
1219
+ # Additional gRPC headers to be sent with the call.
1220
+ # @return [::Hash{::Symbol=>::String}]
1221
+ # @!attribute [rw] retry_policy
1222
+ # The retry policy. The value is a hash with the following keys:
1223
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1224
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1225
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1226
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1227
+ # trigger a retry.
1228
+ # @return [::Hash]
1229
+ # @!attribute [rw] quota_project
1230
+ # A separate project against which to charge quota.
1231
+ # @return [::String]
1232
+ #
1233
+ class Configuration
1234
+ extend ::Gapic::Config
1235
+
1236
+ config_attr :endpoint, "websecurityscanner.googleapis.com", ::String
1237
+ config_attr :credentials, nil do |value|
1238
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1239
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
1240
+ allowed.any? { |klass| klass === value }
1241
+ end
1242
+ config_attr :scope, nil, ::String, ::Array, nil
1243
+ config_attr :lib_name, nil, ::String, nil
1244
+ config_attr :lib_version, nil, ::String, nil
1245
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
1246
+ config_attr :interceptors, nil, ::Array, nil
1247
+ config_attr :timeout, nil, ::Numeric, nil
1248
+ config_attr :metadata, nil, ::Hash, nil
1249
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1250
+ config_attr :quota_project, nil, ::String, nil
1251
+
1252
+ # @private
1253
+ def initialize parent_config = nil
1254
+ @parent_config = parent_config unless parent_config.nil?
1255
+
1256
+ yield self if block_given?
1257
+ end
1258
+
1259
+ ##
1260
+ # Configurations for individual RPCs
1261
+ # @return [Rpcs]
1262
+ #
1263
+ def rpcs
1264
+ @rpcs ||= begin
1265
+ parent_rpcs = nil
1266
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config&.respond_to?(:rpcs)
1267
+ Rpcs.new parent_rpcs
1268
+ end
1269
+ end
1270
+
1271
+ ##
1272
+ # Configuration RPC class for the WebSecurityScanner API.
1273
+ #
1274
+ # Includes fields providing the configuration for each RPC in this service.
1275
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1276
+ # the following configuration fields:
1277
+ #
1278
+ # * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
1279
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
1280
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1281
+ # include the following keys:
1282
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1283
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1284
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1285
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1286
+ # trigger a retry.
1287
+ #
1288
+ class Rpcs
1289
+ ##
1290
+ # RPC-specific configuration for `create_scan_config`
1291
+ # @return [::Gapic::Config::Method]
1292
+ #
1293
+ attr_reader :create_scan_config
1294
+ ##
1295
+ # RPC-specific configuration for `delete_scan_config`
1296
+ # @return [::Gapic::Config::Method]
1297
+ #
1298
+ attr_reader :delete_scan_config
1299
+ ##
1300
+ # RPC-specific configuration for `get_scan_config`
1301
+ # @return [::Gapic::Config::Method]
1302
+ #
1303
+ attr_reader :get_scan_config
1304
+ ##
1305
+ # RPC-specific configuration for `list_scan_configs`
1306
+ # @return [::Gapic::Config::Method]
1307
+ #
1308
+ attr_reader :list_scan_configs
1309
+ ##
1310
+ # RPC-specific configuration for `update_scan_config`
1311
+ # @return [::Gapic::Config::Method]
1312
+ #
1313
+ attr_reader :update_scan_config
1314
+ ##
1315
+ # RPC-specific configuration for `start_scan_run`
1316
+ # @return [::Gapic::Config::Method]
1317
+ #
1318
+ attr_reader :start_scan_run
1319
+ ##
1320
+ # RPC-specific configuration for `get_scan_run`
1321
+ # @return [::Gapic::Config::Method]
1322
+ #
1323
+ attr_reader :get_scan_run
1324
+ ##
1325
+ # RPC-specific configuration for `list_scan_runs`
1326
+ # @return [::Gapic::Config::Method]
1327
+ #
1328
+ attr_reader :list_scan_runs
1329
+ ##
1330
+ # RPC-specific configuration for `stop_scan_run`
1331
+ # @return [::Gapic::Config::Method]
1332
+ #
1333
+ attr_reader :stop_scan_run
1334
+ ##
1335
+ # RPC-specific configuration for `list_crawled_urls`
1336
+ # @return [::Gapic::Config::Method]
1337
+ #
1338
+ attr_reader :list_crawled_urls
1339
+ ##
1340
+ # RPC-specific configuration for `get_finding`
1341
+ # @return [::Gapic::Config::Method]
1342
+ #
1343
+ attr_reader :get_finding
1344
+ ##
1345
+ # RPC-specific configuration for `list_findings`
1346
+ # @return [::Gapic::Config::Method]
1347
+ #
1348
+ attr_reader :list_findings
1349
+ ##
1350
+ # RPC-specific configuration for `list_finding_type_stats`
1351
+ # @return [::Gapic::Config::Method]
1352
+ #
1353
+ attr_reader :list_finding_type_stats
1354
+
1355
+ # @private
1356
+ def initialize parent_rpcs = nil
1357
+ create_scan_config_config = parent_rpcs&.create_scan_config if parent_rpcs&.respond_to? :create_scan_config
1358
+ @create_scan_config = ::Gapic::Config::Method.new create_scan_config_config
1359
+ delete_scan_config_config = parent_rpcs&.delete_scan_config if parent_rpcs&.respond_to? :delete_scan_config
1360
+ @delete_scan_config = ::Gapic::Config::Method.new delete_scan_config_config
1361
+ get_scan_config_config = parent_rpcs&.get_scan_config if parent_rpcs&.respond_to? :get_scan_config
1362
+ @get_scan_config = ::Gapic::Config::Method.new get_scan_config_config
1363
+ list_scan_configs_config = parent_rpcs&.list_scan_configs if parent_rpcs&.respond_to? :list_scan_configs
1364
+ @list_scan_configs = ::Gapic::Config::Method.new list_scan_configs_config
1365
+ update_scan_config_config = parent_rpcs&.update_scan_config if parent_rpcs&.respond_to? :update_scan_config
1366
+ @update_scan_config = ::Gapic::Config::Method.new update_scan_config_config
1367
+ start_scan_run_config = parent_rpcs&.start_scan_run if parent_rpcs&.respond_to? :start_scan_run
1368
+ @start_scan_run = ::Gapic::Config::Method.new start_scan_run_config
1369
+ get_scan_run_config = parent_rpcs&.get_scan_run if parent_rpcs&.respond_to? :get_scan_run
1370
+ @get_scan_run = ::Gapic::Config::Method.new get_scan_run_config
1371
+ list_scan_runs_config = parent_rpcs&.list_scan_runs if parent_rpcs&.respond_to? :list_scan_runs
1372
+ @list_scan_runs = ::Gapic::Config::Method.new list_scan_runs_config
1373
+ stop_scan_run_config = parent_rpcs&.stop_scan_run if parent_rpcs&.respond_to? :stop_scan_run
1374
+ @stop_scan_run = ::Gapic::Config::Method.new stop_scan_run_config
1375
+ list_crawled_urls_config = parent_rpcs&.list_crawled_urls if parent_rpcs&.respond_to? :list_crawled_urls
1376
+ @list_crawled_urls = ::Gapic::Config::Method.new list_crawled_urls_config
1377
+ get_finding_config = parent_rpcs&.get_finding if parent_rpcs&.respond_to? :get_finding
1378
+ @get_finding = ::Gapic::Config::Method.new get_finding_config
1379
+ list_findings_config = parent_rpcs&.list_findings if parent_rpcs&.respond_to? :list_findings
1380
+ @list_findings = ::Gapic::Config::Method.new list_findings_config
1381
+ list_finding_type_stats_config = parent_rpcs&.list_finding_type_stats if parent_rpcs&.respond_to? :list_finding_type_stats
1382
+ @list_finding_type_stats = ::Gapic::Config::Method.new list_finding_type_stats_config
1383
+
1384
+ yield self if block_given?
1385
+ end
1386
+ end
1387
+ end
1388
+ end
1389
+ end
1390
+ end
1391
+ end
1392
+ end
1393
+ end