Skip to content

Commit f09807b

Browse files
1 parent d2a97a9 commit f09807b

3 files changed

Lines changed: 109 additions & 87 deletions

File tree

src/OnDemandScanning/AISkillAnalysisOccurrence.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ class AISkillAnalysisOccurrence extends \Google\Collection
2222
protected $collection_key = 'findings';
2323
protected $findingsType = Finding::class;
2424
protected $findingsDataType = 'array';
25+
/**
26+
* Maximum severity found among findings.
27+
*
28+
* @var string
29+
*/
30+
public $maxSeverity;
2531
/**
2632
* Name of the skill that produced this analysis.
2733
*
@@ -45,6 +51,22 @@ public function getFindings()
4551
{
4652
return $this->findings;
4753
}
54+
/**
55+
* Maximum severity found among findings.
56+
*
57+
* @param string $maxSeverity
58+
*/
59+
public function setMaxSeverity($maxSeverity)
60+
{
61+
$this->maxSeverity = $maxSeverity;
62+
}
63+
/**
64+
* @return string
65+
*/
66+
public function getMaxSeverity()
67+
{
68+
return $this->maxSeverity;
69+
}
4870
/**
4971
* Name of the skill that produced this analysis.
5072
*

src/OnDemandScanning/Finding.php

Lines changed: 17 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -25,42 +25,20 @@ class Finding extends \Google\Model
2525
* @var string
2626
*/
2727
public $category;
28+
protected $locationType = FindingLocation::class;
29+
protected $locationDataType = '';
2830
/**
29-
* Detailed description of the finding.
31+
* Scanner determines which engine (e.g. static, llm) emitted the finding.
3032
*
3133
* @var string
3234
*/
33-
public $description;
34-
/**
35-
* Path to the file where the finding was detected.
36-
*
37-
* @var string
38-
*/
39-
public $filePath;
40-
/**
41-
* Unique identifier of the rule that produced this finding.
42-
*
43-
* @var string
44-
*/
45-
public $ruleId;
35+
public $scanner;
4636
/**
4737
* Severity of the finding.
4838
*
4939
* @var string
5040
*/
5141
public $severity;
52-
/**
53-
* Code snippet relevant to the finding.
54-
*
55-
* @var string
56-
*/
57-
public $snippet;
58-
/**
59-
* Title of the finding.
60-
*
61-
* @var string
62-
*/
63-
public $title;
6442

6543
/**
6644
* Category of the finding.
@@ -79,52 +57,36 @@ public function getCategory()
7957
return $this->category;
8058
}
8159
/**
82-
* Detailed description of the finding.
60+
* Location (path and line) where the finding was detected.
8361
*
84-
* @param string $description
62+
* @param FindingLocation $location
8563
*/
86-
public function setDescription($description)
64+
public function setLocation(FindingLocation $location)
8765
{
88-
$this->description = $description;
66+
$this->location = $location;
8967
}
9068
/**
91-
* @return string
69+
* @return FindingLocation
9270
*/
93-
public function getDescription()
71+
public function getLocation()
9472
{
95-
return $this->description;
73+
return $this->location;
9674
}
9775
/**
98-
* Path to the file where the finding was detected.
76+
* Scanner determines which engine (e.g. static, llm) emitted the finding.
9977
*
100-
* @param string $filePath
78+
* @param string $scanner
10179
*/
102-
public function setFilePath($filePath)
80+
public function setScanner($scanner)
10381
{
104-
$this->filePath = $filePath;
82+
$this->scanner = $scanner;
10583
}
10684
/**
10785
* @return string
10886
*/
109-
public function getFilePath()
110-
{
111-
return $this->filePath;
112-
}
113-
/**
114-
* Unique identifier of the rule that produced this finding.
115-
*
116-
* @param string $ruleId
117-
*/
118-
public function setRuleId($ruleId)
87+
public function getScanner()
11988
{
120-
$this->ruleId = $ruleId;
121-
}
122-
/**
123-
* @return string
124-
*/
125-
public function getRuleId()
126-
{
127-
return $this->ruleId;
89+
return $this->scanner;
12890
}
12991
/**
13092
* Severity of the finding.
@@ -142,38 +104,6 @@ public function getSeverity()
142104
{
143105
return $this->severity;
144106
}
145-
/**
146-
* Code snippet relevant to the finding.
147-
*
148-
* @param string $snippet
149-
*/
150-
public function setSnippet($snippet)
151-
{
152-
$this->snippet = $snippet;
153-
}
154-
/**
155-
* @return string
156-
*/
157-
public function getSnippet()
158-
{
159-
return $this->snippet;
160-
}
161-
/**
162-
* Title of the finding.
163-
*
164-
* @param string $title
165-
*/
166-
public function setTitle($title)
167-
{
168-
$this->title = $title;
169-
}
170-
/**
171-
* @return string
172-
*/
173-
public function getTitle()
174-
{
175-
return $this->title;
176-
}
177107
}
178108

179109
// Adding a class alias for backwards compatibility with the previous class name.
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
<?php
2+
/*
3+
* Copyright 2014 Google Inc.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
6+
* use this file except in compliance with the License. You may obtain a copy of
7+
* the License at
8+
*
9+
* http://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, WITHOUT
13+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14+
* License for the specific language governing permissions and limitations under
15+
* the License.
16+
*/
17+
18+
namespace Google\Service\OnDemandScanning;
19+
20+
class FindingLocation extends \Google\Model
21+
{
22+
/**
23+
* Relative path of the file containing the finding.
24+
*
25+
* @var string
26+
*/
27+
public $filePath;
28+
/**
29+
* Line number (1-based), or 0 if whole File / unknown.
30+
*
31+
* @var string
32+
*/
33+
public $lineNumber;
34+
35+
/**
36+
* Relative path of the file containing the finding.
37+
*
38+
* @param string $filePath
39+
*/
40+
public function setFilePath($filePath)
41+
{
42+
$this->filePath = $filePath;
43+
}
44+
/**
45+
* @return string
46+
*/
47+
public function getFilePath()
48+
{
49+
return $this->filePath;
50+
}
51+
/**
52+
* Line number (1-based), or 0 if whole File / unknown.
53+
*
54+
* @param string $lineNumber
55+
*/
56+
public function setLineNumber($lineNumber)
57+
{
58+
$this->lineNumber = $lineNumber;
59+
}
60+
/**
61+
* @return string
62+
*/
63+
public function getLineNumber()
64+
{
65+
return $this->lineNumber;
66+
}
67+
}
68+
69+
// Adding a class alias for backwards compatibility with the previous class name.
70+
class_alias(FindingLocation::class, 'Google_Service_OnDemandScanning_FindingLocation');

0 commit comments

Comments
 (0)