Skip to content

Commit 8283f93

Browse files
1 parent 03b7cb2 commit 8283f93

3 files changed

Lines changed: 271 additions & 1 deletion

File tree

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
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 AISkillAnalysisOccurrence extends \Google\Collection
21+
{
22+
protected $collection_key = 'findings';
23+
protected $findingsType = Finding::class;
24+
protected $findingsDataType = 'array';
25+
/**
26+
* Name of the skill that produced this analysis.
27+
*
28+
* @var string
29+
*/
30+
public $skillName;
31+
32+
/**
33+
* Findings produced by the analysis.
34+
*
35+
* @param Finding[] $findings
36+
*/
37+
public function setFindings($findings)
38+
{
39+
$this->findings = $findings;
40+
}
41+
/**
42+
* @return Finding[]
43+
*/
44+
public function getFindings()
45+
{
46+
return $this->findings;
47+
}
48+
/**
49+
* Name of the skill that produced this analysis.
50+
*
51+
* @param string $skillName
52+
*/
53+
public function setSkillName($skillName)
54+
{
55+
$this->skillName = $skillName;
56+
}
57+
/**
58+
* @return string
59+
*/
60+
public function getSkillName()
61+
{
62+
return $this->skillName;
63+
}
64+
}
65+
66+
// Adding a class alias for backwards compatibility with the previous class name.
67+
class_alias(AISkillAnalysisOccurrence::class, 'Google_Service_OnDemandScanning_AISkillAnalysisOccurrence');

src/OnDemandScanning/Finding.php

Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
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 Finding extends \Google\Model
21+
{
22+
/**
23+
* Category of the finding.
24+
*
25+
* @var string
26+
*/
27+
public $category;
28+
/**
29+
* Detailed description of the finding.
30+
*
31+
* @var string
32+
*/
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;
46+
/**
47+
* Severity of the finding.
48+
*
49+
* @var string
50+
*/
51+
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;
64+
65+
/**
66+
* Category of the finding.
67+
*
68+
* @param string $category
69+
*/
70+
public function setCategory($category)
71+
{
72+
$this->category = $category;
73+
}
74+
/**
75+
* @return string
76+
*/
77+
public function getCategory()
78+
{
79+
return $this->category;
80+
}
81+
/**
82+
* Detailed description of the finding.
83+
*
84+
* @param string $description
85+
*/
86+
public function setDescription($description)
87+
{
88+
$this->description = $description;
89+
}
90+
/**
91+
* @return string
92+
*/
93+
public function getDescription()
94+
{
95+
return $this->description;
96+
}
97+
/**
98+
* Path to the file where the finding was detected.
99+
*
100+
* @param string $filePath
101+
*/
102+
public function setFilePath($filePath)
103+
{
104+
$this->filePath = $filePath;
105+
}
106+
/**
107+
* @return string
108+
*/
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)
119+
{
120+
$this->ruleId = $ruleId;
121+
}
122+
/**
123+
* @return string
124+
*/
125+
public function getRuleId()
126+
{
127+
return $this->ruleId;
128+
}
129+
/**
130+
* Severity of the finding.
131+
*
132+
* @param string $severity
133+
*/
134+
public function setSeverity($severity)
135+
{
136+
$this->severity = $severity;
137+
}
138+
/**
139+
* @return string
140+
*/
141+
public function getSeverity()
142+
{
143+
return $this->severity;
144+
}
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+
}
177+
}
178+
179+
// Adding a class alias for backwards compatibility with the previous class name.
180+
class_alias(Finding::class, 'Google_Service_OnDemandScanning_Finding');

src/OnDemandScanning/Occurrence.php

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,18 @@ class Occurrence extends \Google\Model
7575
* This represents a secret.
7676
*/
7777
public const KIND_SECRET = 'SECRET';
78+
/**
79+
* This represents an AI skill analysis.
80+
*/
81+
public const KIND_AI_SKILL_ANALYSIS = 'AI_SKILL_ANALYSIS';
7882
/**
7983
* The time this advisory was published by the source.
8084
*
8185
* @var string
8286
*/
8387
public $advisoryPublishTime;
88+
protected $aiSkillAnalysisType = AISkillAnalysisOccurrence::class;
89+
protected $aiSkillAnalysisDataType = '';
8490
protected $attestationType = AttestationOccurrence::class;
8591
protected $attestationDataType = '';
8692
protected $buildType = BuildOccurrence::class;
@@ -172,6 +178,22 @@ public function getAdvisoryPublishTime()
172178
{
173179
return $this->advisoryPublishTime;
174180
}
181+
/**
182+
* Describes an AI skill analysis.
183+
*
184+
* @param AISkillAnalysisOccurrence $aiSkillAnalysis
185+
*/
186+
public function setAiSkillAnalysis(AISkillAnalysisOccurrence $aiSkillAnalysis)
187+
{
188+
$this->aiSkillAnalysis = $aiSkillAnalysis;
189+
}
190+
/**
191+
* @return AISkillAnalysisOccurrence
192+
*/
193+
public function getAiSkillAnalysis()
194+
{
195+
return $this->aiSkillAnalysis;
196+
}
175197
/**
176198
* Describes an attestation of an artifact.
177199
*
@@ -322,7 +344,8 @@ public function getImage()
322344
*
323345
* Accepted values: NOTE_KIND_UNSPECIFIED, VULNERABILITY, BUILD, IMAGE,
324346
* PACKAGE, DEPLOYMENT, DISCOVERY, ATTESTATION, UPGRADE, COMPLIANCE,
325-
* DSSE_ATTESTATION, VULNERABILITY_ASSESSMENT, SBOM_REFERENCE, SECRET
347+
* DSSE_ATTESTATION, VULNERABILITY_ASSESSMENT, SBOM_REFERENCE, SECRET,
348+
* AI_SKILL_ANALYSIS
326349
*
327350
* @param self::KIND_* $kind
328351
*/

0 commit comments

Comments
 (0)