google-cloud-web_security_scanner-v1beta 0.1.0

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