google-apis-websecurityscanner_v1beta 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,529 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'google/apis/core/base_service'
16
+ require 'google/apis/core/json_representation'
17
+ require 'google/apis/core/hashable'
18
+ require 'google/apis/errors'
19
+
20
+ module Google
21
+ module Apis
22
+ module WebsecurityscannerV1beta
23
+ # Web Security Scanner API
24
+ #
25
+ # Scans your Compute and App Engine apps for common web vulnerabilities.
26
+ #
27
+ # @example
28
+ # require 'google/apis/websecurityscanner_v1beta'
29
+ #
30
+ # Websecurityscanner = Google::Apis::WebsecurityscannerV1beta # Alias the module
31
+ # service = Websecurityscanner::WebSecurityScannerService.new
32
+ #
33
+ # @see https://cloud.google.com/security-command-center/docs/concepts-web-security-scanner-overview/
34
+ class WebSecurityScannerService < Google::Apis::Core::BaseService
35
+ # @return [String]
36
+ # API key. Your API key identifies your project and provides you with API access,
37
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
38
+ attr_accessor :key
39
+
40
+ # @return [String]
41
+ # Available to use for quota purposes for server-side applications. Can be any
42
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
43
+ attr_accessor :quota_user
44
+
45
+ def initialize
46
+ super('https://websecurityscanner.googleapis.com/', '',
47
+ client_name: 'google-apis-websecurityscanner_v1beta',
48
+ client_version: Google::Apis::WebsecurityscannerV1beta::GEM_VERSION)
49
+ @batch_path = 'batch'
50
+ end
51
+
52
+ # Creates a new ScanConfig.
53
+ # @param [String] parent
54
+ # Required. The parent resource name where the scan is created, which should be
55
+ # a project resource name in the format 'projects/`projectId`'.
56
+ # @param [Google::Apis::WebsecurityscannerV1beta::ScanConfig] scan_config_object
57
+ # @param [String] fields
58
+ # Selector specifying which fields to include in a partial response.
59
+ # @param [String] quota_user
60
+ # Available to use for quota purposes for server-side applications. Can be any
61
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
62
+ # @param [Google::Apis::RequestOptions] options
63
+ # Request-specific options
64
+ #
65
+ # @yield [result, err] Result & error if block supplied
66
+ # @yieldparam result [Google::Apis::WebsecurityscannerV1beta::ScanConfig] parsed result object
67
+ # @yieldparam err [StandardError] error object if request failed
68
+ #
69
+ # @return [Google::Apis::WebsecurityscannerV1beta::ScanConfig]
70
+ #
71
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
72
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
73
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
74
+ def create_project_scan_config(parent, scan_config_object = nil, fields: nil, quota_user: nil, options: nil, &block)
75
+ command = make_simple_command(:post, 'v1beta/{+parent}/scanConfigs', options)
76
+ command.request_representation = Google::Apis::WebsecurityscannerV1beta::ScanConfig::Representation
77
+ command.request_object = scan_config_object
78
+ command.response_representation = Google::Apis::WebsecurityscannerV1beta::ScanConfig::Representation
79
+ command.response_class = Google::Apis::WebsecurityscannerV1beta::ScanConfig
80
+ command.params['parent'] = parent unless parent.nil?
81
+ command.query['fields'] = fields unless fields.nil?
82
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
83
+ execute_or_queue_command(command, &block)
84
+ end
85
+
86
+ # Deletes an existing ScanConfig and its child resources.
87
+ # @param [String] name
88
+ # Required. The resource name of the ScanConfig to be deleted. The name follows
89
+ # the format of 'projects/`projectId`/scanConfigs/`scanConfigId`'.
90
+ # @param [String] fields
91
+ # Selector specifying which fields to include in a partial response.
92
+ # @param [String] quota_user
93
+ # Available to use for quota purposes for server-side applications. Can be any
94
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
95
+ # @param [Google::Apis::RequestOptions] options
96
+ # Request-specific options
97
+ #
98
+ # @yield [result, err] Result & error if block supplied
99
+ # @yieldparam result [Google::Apis::WebsecurityscannerV1beta::Empty] parsed result object
100
+ # @yieldparam err [StandardError] error object if request failed
101
+ #
102
+ # @return [Google::Apis::WebsecurityscannerV1beta::Empty]
103
+ #
104
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
105
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
106
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
107
+ def delete_project_scan_config(name, fields: nil, quota_user: nil, options: nil, &block)
108
+ command = make_simple_command(:delete, 'v1beta/{+name}', options)
109
+ command.response_representation = Google::Apis::WebsecurityscannerV1beta::Empty::Representation
110
+ command.response_class = Google::Apis::WebsecurityscannerV1beta::Empty
111
+ command.params['name'] = name unless name.nil?
112
+ command.query['fields'] = fields unless fields.nil?
113
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
114
+ execute_or_queue_command(command, &block)
115
+ end
116
+
117
+ # Gets a ScanConfig.
118
+ # @param [String] name
119
+ # Required. The resource name of the ScanConfig to be returned. The name follows
120
+ # the format of 'projects/`projectId`/scanConfigs/`scanConfigId`'.
121
+ # @param [String] fields
122
+ # Selector specifying which fields to include in a partial response.
123
+ # @param [String] quota_user
124
+ # Available to use for quota purposes for server-side applications. Can be any
125
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
126
+ # @param [Google::Apis::RequestOptions] options
127
+ # Request-specific options
128
+ #
129
+ # @yield [result, err] Result & error if block supplied
130
+ # @yieldparam result [Google::Apis::WebsecurityscannerV1beta::ScanConfig] parsed result object
131
+ # @yieldparam err [StandardError] error object if request failed
132
+ #
133
+ # @return [Google::Apis::WebsecurityscannerV1beta::ScanConfig]
134
+ #
135
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
136
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
137
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
138
+ def get_project_scan_config(name, fields: nil, quota_user: nil, options: nil, &block)
139
+ command = make_simple_command(:get, 'v1beta/{+name}', options)
140
+ command.response_representation = Google::Apis::WebsecurityscannerV1beta::ScanConfig::Representation
141
+ command.response_class = Google::Apis::WebsecurityscannerV1beta::ScanConfig
142
+ command.params['name'] = name unless name.nil?
143
+ command.query['fields'] = fields unless fields.nil?
144
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
145
+ execute_or_queue_command(command, &block)
146
+ end
147
+
148
+ # Lists ScanConfigs under a given project.
149
+ # @param [String] parent
150
+ # Required. The parent resource name, which should be a project resource name in
151
+ # the format 'projects/`projectId`'.
152
+ # @param [Fixnum] page_size
153
+ # The maximum number of ScanConfigs to return, can be limited by server. If not
154
+ # specified or not positive, the implementation will select a reasonable value.
155
+ # @param [String] page_token
156
+ # A token identifying a page of results to be returned. This should be a `
157
+ # next_page_token` value returned from a previous List request. If unspecified,
158
+ # the first page of results is returned.
159
+ # @param [String] fields
160
+ # Selector specifying which fields to include in a partial response.
161
+ # @param [String] quota_user
162
+ # Available to use for quota purposes for server-side applications. Can be any
163
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
164
+ # @param [Google::Apis::RequestOptions] options
165
+ # Request-specific options
166
+ #
167
+ # @yield [result, err] Result & error if block supplied
168
+ # @yieldparam result [Google::Apis::WebsecurityscannerV1beta::ListScanConfigsResponse] parsed result object
169
+ # @yieldparam err [StandardError] error object if request failed
170
+ #
171
+ # @return [Google::Apis::WebsecurityscannerV1beta::ListScanConfigsResponse]
172
+ #
173
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
174
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
175
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
176
+ def list_project_scan_configs(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
177
+ command = make_simple_command(:get, 'v1beta/{+parent}/scanConfigs', options)
178
+ command.response_representation = Google::Apis::WebsecurityscannerV1beta::ListScanConfigsResponse::Representation
179
+ command.response_class = Google::Apis::WebsecurityscannerV1beta::ListScanConfigsResponse
180
+ command.params['parent'] = parent unless parent.nil?
181
+ command.query['pageSize'] = page_size unless page_size.nil?
182
+ command.query['pageToken'] = page_token unless page_token.nil?
183
+ command.query['fields'] = fields unless fields.nil?
184
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
185
+ execute_or_queue_command(command, &block)
186
+ end
187
+
188
+ # Updates a ScanConfig. This method support partial update of a ScanConfig.
189
+ # @param [String] name
190
+ # The resource name of the ScanConfig. The name follows the format of 'projects/`
191
+ # projectId`/scanConfigs/`scanConfigId`'. The ScanConfig IDs are generated by
192
+ # the system.
193
+ # @param [Google::Apis::WebsecurityscannerV1beta::ScanConfig] scan_config_object
194
+ # @param [String] update_mask
195
+ # Required. The update mask applies to the resource. For the `FieldMask`
196
+ # definition, see https://developers.google.com/protocol-buffers/docs/reference/
197
+ # google.protobuf#fieldmask
198
+ # @param [String] fields
199
+ # Selector specifying which fields to include in a partial response.
200
+ # @param [String] quota_user
201
+ # Available to use for quota purposes for server-side applications. Can be any
202
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
203
+ # @param [Google::Apis::RequestOptions] options
204
+ # Request-specific options
205
+ #
206
+ # @yield [result, err] Result & error if block supplied
207
+ # @yieldparam result [Google::Apis::WebsecurityscannerV1beta::ScanConfig] parsed result object
208
+ # @yieldparam err [StandardError] error object if request failed
209
+ #
210
+ # @return [Google::Apis::WebsecurityscannerV1beta::ScanConfig]
211
+ #
212
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
213
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
214
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
215
+ def patch_project_scan_config(name, scan_config_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
216
+ command = make_simple_command(:patch, 'v1beta/{+name}', options)
217
+ command.request_representation = Google::Apis::WebsecurityscannerV1beta::ScanConfig::Representation
218
+ command.request_object = scan_config_object
219
+ command.response_representation = Google::Apis::WebsecurityscannerV1beta::ScanConfig::Representation
220
+ command.response_class = Google::Apis::WebsecurityscannerV1beta::ScanConfig
221
+ command.params['name'] = name unless name.nil?
222
+ command.query['updateMask'] = update_mask unless update_mask.nil?
223
+ command.query['fields'] = fields unless fields.nil?
224
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
225
+ execute_or_queue_command(command, &block)
226
+ end
227
+
228
+ # Start a ScanRun according to the given ScanConfig.
229
+ # @param [String] name
230
+ # Required. The resource name of the ScanConfig to be used. The name follows the
231
+ # format of 'projects/`projectId`/scanConfigs/`scanConfigId`'.
232
+ # @param [Google::Apis::WebsecurityscannerV1beta::StartScanRunRequest] start_scan_run_request_object
233
+ # @param [String] fields
234
+ # Selector specifying which fields to include in a partial response.
235
+ # @param [String] quota_user
236
+ # Available to use for quota purposes for server-side applications. Can be any
237
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
238
+ # @param [Google::Apis::RequestOptions] options
239
+ # Request-specific options
240
+ #
241
+ # @yield [result, err] Result & error if block supplied
242
+ # @yieldparam result [Google::Apis::WebsecurityscannerV1beta::ScanRun] parsed result object
243
+ # @yieldparam err [StandardError] error object if request failed
244
+ #
245
+ # @return [Google::Apis::WebsecurityscannerV1beta::ScanRun]
246
+ #
247
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
248
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
249
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
250
+ def start_scan_config_scan_run(name, start_scan_run_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
251
+ command = make_simple_command(:post, 'v1beta/{+name}:start', options)
252
+ command.request_representation = Google::Apis::WebsecurityscannerV1beta::StartScanRunRequest::Representation
253
+ command.request_object = start_scan_run_request_object
254
+ command.response_representation = Google::Apis::WebsecurityscannerV1beta::ScanRun::Representation
255
+ command.response_class = Google::Apis::WebsecurityscannerV1beta::ScanRun
256
+ command.params['name'] = name unless name.nil?
257
+ command.query['fields'] = fields unless fields.nil?
258
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
259
+ execute_or_queue_command(command, &block)
260
+ end
261
+
262
+ # Gets a ScanRun.
263
+ # @param [String] name
264
+ # Required. The resource name of the ScanRun to be returned. The name follows
265
+ # the format of 'projects/`projectId`/scanConfigs/`scanConfigId`/scanRuns/`
266
+ # scanRunId`'.
267
+ # @param [String] fields
268
+ # Selector specifying which fields to include in a partial response.
269
+ # @param [String] quota_user
270
+ # Available to use for quota purposes for server-side applications. Can be any
271
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
272
+ # @param [Google::Apis::RequestOptions] options
273
+ # Request-specific options
274
+ #
275
+ # @yield [result, err] Result & error if block supplied
276
+ # @yieldparam result [Google::Apis::WebsecurityscannerV1beta::ScanRun] parsed result object
277
+ # @yieldparam err [StandardError] error object if request failed
278
+ #
279
+ # @return [Google::Apis::WebsecurityscannerV1beta::ScanRun]
280
+ #
281
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
282
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
283
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
284
+ def get_project_scan_config_scan_run(name, fields: nil, quota_user: nil, options: nil, &block)
285
+ command = make_simple_command(:get, 'v1beta/{+name}', options)
286
+ command.response_representation = Google::Apis::WebsecurityscannerV1beta::ScanRun::Representation
287
+ command.response_class = Google::Apis::WebsecurityscannerV1beta::ScanRun
288
+ command.params['name'] = name unless name.nil?
289
+ command.query['fields'] = fields unless fields.nil?
290
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
291
+ execute_or_queue_command(command, &block)
292
+ end
293
+
294
+ # Lists ScanRuns under a given ScanConfig, in descending order of ScanRun stop
295
+ # time.
296
+ # @param [String] parent
297
+ # Required. The parent resource name, which should be a scan resource name in
298
+ # the format 'projects/`projectId`/scanConfigs/`scanConfigId`'.
299
+ # @param [Fixnum] page_size
300
+ # The maximum number of ScanRuns to return, can be limited by server. If not
301
+ # specified or not positive, the implementation will select a reasonable value.
302
+ # @param [String] page_token
303
+ # A token identifying a page of results to be returned. This should be a `
304
+ # next_page_token` value returned from a previous List request. If unspecified,
305
+ # the first page of results is returned.
306
+ # @param [String] fields
307
+ # Selector specifying which fields to include in a partial response.
308
+ # @param [String] quota_user
309
+ # Available to use for quota purposes for server-side applications. Can be any
310
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
311
+ # @param [Google::Apis::RequestOptions] options
312
+ # Request-specific options
313
+ #
314
+ # @yield [result, err] Result & error if block supplied
315
+ # @yieldparam result [Google::Apis::WebsecurityscannerV1beta::ListScanRunsResponse] parsed result object
316
+ # @yieldparam err [StandardError] error object if request failed
317
+ #
318
+ # @return [Google::Apis::WebsecurityscannerV1beta::ListScanRunsResponse]
319
+ #
320
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
321
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
322
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
323
+ def list_project_scan_config_scan_runs(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
324
+ command = make_simple_command(:get, 'v1beta/{+parent}/scanRuns', options)
325
+ command.response_representation = Google::Apis::WebsecurityscannerV1beta::ListScanRunsResponse::Representation
326
+ command.response_class = Google::Apis::WebsecurityscannerV1beta::ListScanRunsResponse
327
+ command.params['parent'] = parent unless parent.nil?
328
+ command.query['pageSize'] = page_size unless page_size.nil?
329
+ command.query['pageToken'] = page_token unless page_token.nil?
330
+ command.query['fields'] = fields unless fields.nil?
331
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
332
+ execute_or_queue_command(command, &block)
333
+ end
334
+
335
+ # Stops a ScanRun. The stopped ScanRun is returned.
336
+ # @param [String] name
337
+ # Required. The resource name of the ScanRun to be stopped. The name follows the
338
+ # format of 'projects/`projectId`/scanConfigs/`scanConfigId`/scanRuns/`scanRunId`
339
+ # '.
340
+ # @param [Google::Apis::WebsecurityscannerV1beta::StopScanRunRequest] stop_scan_run_request_object
341
+ # @param [String] fields
342
+ # Selector specifying which fields to include in a partial response.
343
+ # @param [String] quota_user
344
+ # Available to use for quota purposes for server-side applications. Can be any
345
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
346
+ # @param [Google::Apis::RequestOptions] options
347
+ # Request-specific options
348
+ #
349
+ # @yield [result, err] Result & error if block supplied
350
+ # @yieldparam result [Google::Apis::WebsecurityscannerV1beta::ScanRun] parsed result object
351
+ # @yieldparam err [StandardError] error object if request failed
352
+ #
353
+ # @return [Google::Apis::WebsecurityscannerV1beta::ScanRun]
354
+ #
355
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
356
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
357
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
358
+ def stop_scan_run(name, stop_scan_run_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
359
+ command = make_simple_command(:post, 'v1beta/{+name}:stop', options)
360
+ command.request_representation = Google::Apis::WebsecurityscannerV1beta::StopScanRunRequest::Representation
361
+ command.request_object = stop_scan_run_request_object
362
+ command.response_representation = Google::Apis::WebsecurityscannerV1beta::ScanRun::Representation
363
+ command.response_class = Google::Apis::WebsecurityscannerV1beta::ScanRun
364
+ command.params['name'] = name unless name.nil?
365
+ command.query['fields'] = fields unless fields.nil?
366
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
367
+ execute_or_queue_command(command, &block)
368
+ end
369
+
370
+ # List CrawledUrls under a given ScanRun.
371
+ # @param [String] parent
372
+ # Required. The parent resource name, which should be a scan run resource name
373
+ # in the format 'projects/`projectId`/scanConfigs/`scanConfigId`/scanRuns/`
374
+ # scanRunId`'.
375
+ # @param [Fixnum] page_size
376
+ # The maximum number of CrawledUrls to return, can be limited by server. If not
377
+ # specified or not positive, the implementation will select a reasonable value.
378
+ # @param [String] page_token
379
+ # A token identifying a page of results to be returned. This should be a `
380
+ # next_page_token` value returned from a previous List request. If unspecified,
381
+ # the first page of results is returned.
382
+ # @param [String] fields
383
+ # Selector specifying which fields to include in a partial response.
384
+ # @param [String] quota_user
385
+ # Available to use for quota purposes for server-side applications. Can be any
386
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
387
+ # @param [Google::Apis::RequestOptions] options
388
+ # Request-specific options
389
+ #
390
+ # @yield [result, err] Result & error if block supplied
391
+ # @yieldparam result [Google::Apis::WebsecurityscannerV1beta::ListCrawledUrlsResponse] parsed result object
392
+ # @yieldparam err [StandardError] error object if request failed
393
+ #
394
+ # @return [Google::Apis::WebsecurityscannerV1beta::ListCrawledUrlsResponse]
395
+ #
396
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
397
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
398
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
399
+ def list_project_scan_config_scan_run_crawled_urls(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
400
+ command = make_simple_command(:get, 'v1beta/{+parent}/crawledUrls', options)
401
+ command.response_representation = Google::Apis::WebsecurityscannerV1beta::ListCrawledUrlsResponse::Representation
402
+ command.response_class = Google::Apis::WebsecurityscannerV1beta::ListCrawledUrlsResponse
403
+ command.params['parent'] = parent unless parent.nil?
404
+ command.query['pageSize'] = page_size unless page_size.nil?
405
+ command.query['pageToken'] = page_token unless page_token.nil?
406
+ command.query['fields'] = fields unless fields.nil?
407
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
408
+ execute_or_queue_command(command, &block)
409
+ end
410
+
411
+ # List all FindingTypeStats under a given ScanRun.
412
+ # @param [String] parent
413
+ # Required. The parent resource name, which should be a scan run resource name
414
+ # in the format 'projects/`projectId`/scanConfigs/`scanConfigId`/scanRuns/`
415
+ # scanRunId`'.
416
+ # @param [String] fields
417
+ # Selector specifying which fields to include in a partial response.
418
+ # @param [String] quota_user
419
+ # Available to use for quota purposes for server-side applications. Can be any
420
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
421
+ # @param [Google::Apis::RequestOptions] options
422
+ # Request-specific options
423
+ #
424
+ # @yield [result, err] Result & error if block supplied
425
+ # @yieldparam result [Google::Apis::WebsecurityscannerV1beta::ListFindingTypeStatsResponse] parsed result object
426
+ # @yieldparam err [StandardError] error object if request failed
427
+ #
428
+ # @return [Google::Apis::WebsecurityscannerV1beta::ListFindingTypeStatsResponse]
429
+ #
430
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
431
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
432
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
433
+ def list_project_scan_config_scan_run_finding_type_stats(parent, fields: nil, quota_user: nil, options: nil, &block)
434
+ command = make_simple_command(:get, 'v1beta/{+parent}/findingTypeStats', options)
435
+ command.response_representation = Google::Apis::WebsecurityscannerV1beta::ListFindingTypeStatsResponse::Representation
436
+ command.response_class = Google::Apis::WebsecurityscannerV1beta::ListFindingTypeStatsResponse
437
+ command.params['parent'] = parent unless parent.nil?
438
+ command.query['fields'] = fields unless fields.nil?
439
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
440
+ execute_or_queue_command(command, &block)
441
+ end
442
+
443
+ # Gets a Finding.
444
+ # @param [String] name
445
+ # Required. The resource name of the Finding to be returned. The name follows
446
+ # the format of 'projects/`projectId`/scanConfigs/`scanConfigId`/scanRuns/`
447
+ # scanRunId`/findings/`findingId`'.
448
+ # @param [String] fields
449
+ # Selector specifying which fields to include in a partial response.
450
+ # @param [String] quota_user
451
+ # Available to use for quota purposes for server-side applications. Can be any
452
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
453
+ # @param [Google::Apis::RequestOptions] options
454
+ # Request-specific options
455
+ #
456
+ # @yield [result, err] Result & error if block supplied
457
+ # @yieldparam result [Google::Apis::WebsecurityscannerV1beta::Finding] parsed result object
458
+ # @yieldparam err [StandardError] error object if request failed
459
+ #
460
+ # @return [Google::Apis::WebsecurityscannerV1beta::Finding]
461
+ #
462
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
463
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
464
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
465
+ def get_project_scan_config_scan_run_finding(name, fields: nil, quota_user: nil, options: nil, &block)
466
+ command = make_simple_command(:get, 'v1beta/{+name}', options)
467
+ command.response_representation = Google::Apis::WebsecurityscannerV1beta::Finding::Representation
468
+ command.response_class = Google::Apis::WebsecurityscannerV1beta::Finding
469
+ command.params['name'] = name unless name.nil?
470
+ command.query['fields'] = fields unless fields.nil?
471
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
472
+ execute_or_queue_command(command, &block)
473
+ end
474
+
475
+ # List Findings under a given ScanRun.
476
+ # @param [String] parent
477
+ # Required. The parent resource name, which should be a scan run resource name
478
+ # in the format 'projects/`projectId`/scanConfigs/`scanConfigId`/scanRuns/`
479
+ # scanRunId`'.
480
+ # @param [String] filter
481
+ # Required. The filter expression. The expression must be in the format: .
482
+ # Supported field: 'finding_type'. Supported operator: '='.
483
+ # @param [Fixnum] page_size
484
+ # The maximum number of Findings to return, can be limited by server. If not
485
+ # specified or not positive, the implementation will select a reasonable value.
486
+ # @param [String] page_token
487
+ # A token identifying a page of results to be returned. This should be a `
488
+ # next_page_token` value returned from a previous List request. If unspecified,
489
+ # the first page of results is returned.
490
+ # @param [String] fields
491
+ # Selector specifying which fields to include in a partial response.
492
+ # @param [String] quota_user
493
+ # Available to use for quota purposes for server-side applications. Can be any
494
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
495
+ # @param [Google::Apis::RequestOptions] options
496
+ # Request-specific options
497
+ #
498
+ # @yield [result, err] Result & error if block supplied
499
+ # @yieldparam result [Google::Apis::WebsecurityscannerV1beta::ListFindingsResponse] parsed result object
500
+ # @yieldparam err [StandardError] error object if request failed
501
+ #
502
+ # @return [Google::Apis::WebsecurityscannerV1beta::ListFindingsResponse]
503
+ #
504
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
505
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
506
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
507
+ def list_project_scan_config_scan_run_findings(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
508
+ command = make_simple_command(:get, 'v1beta/{+parent}/findings', options)
509
+ command.response_representation = Google::Apis::WebsecurityscannerV1beta::ListFindingsResponse::Representation
510
+ command.response_class = Google::Apis::WebsecurityscannerV1beta::ListFindingsResponse
511
+ command.params['parent'] = parent unless parent.nil?
512
+ command.query['filter'] = filter unless filter.nil?
513
+ command.query['pageSize'] = page_size unless page_size.nil?
514
+ command.query['pageToken'] = page_token unless page_token.nil?
515
+ command.query['fields'] = fields unless fields.nil?
516
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
517
+ execute_or_queue_command(command, &block)
518
+ end
519
+
520
+ protected
521
+
522
+ def apply_command_defaults(command)
523
+ command.query['key'] = key unless key.nil?
524
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
525
+ end
526
+ end
527
+ end
528
+ end
529
+ end