-
Notifications
You must be signed in to change notification settings - Fork 148
Expand file tree
/
Copy pathIncident.php
More file actions
510 lines (463 loc) · 22.1 KB
/
Incident.php
File metadata and controls
510 lines (463 loc) · 22.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
<?php
namespace Microsoft\Graph\Generated\Models\Security;
use DateTime;
use Microsoft\Graph\Generated\Models\Entity;
use Microsoft\Kiota\Abstractions\Serialization\Parsable;
use Microsoft\Kiota\Abstractions\Serialization\ParseNode;
use Microsoft\Kiota\Abstractions\Serialization\SerializationWriter;
use Microsoft\Kiota\Abstractions\Types\TypeUtils;
class Incident extends Entity implements Parsable
{
/**
* Instantiates a new Incident and sets the default values.
*/
public function __construct() {
parent::__construct();
}
/**
* Creates a new instance of the appropriate class based on discriminator value
* @param ParseNode $parseNode The parse node to use to read the discriminator value and create the object
* @return Incident
*/
public static function createFromDiscriminatorValue(ParseNode $parseNode): Incident {
return new Incident();
}
/**
* Gets the alerts property value. The list of related alerts. Supports $expand.
* @return array<Alert>|null
*/
public function getAlerts(): ?array {
$val = $this->getBackingStore()->get('alerts');
if (is_array($val) || is_null($val)) {
TypeUtils::validateCollectionValues($val, Alert::class);
/** @var array<Alert>|null $val */
return $val;
}
throw new \UnexpectedValueException("Invalid type found in backing store for 'alerts'");
}
/**
* Gets the assignedTo property value. Owner of the incident, or null if no owner is assigned. Free editable text.
* @return string|null
*/
public function getAssignedTo(): ?string {
$val = $this->getBackingStore()->get('assignedTo');
if (is_null($val) || is_string($val)) {
return $val;
}
throw new \UnexpectedValueException("Invalid type found in backing store for 'assignedTo'");
}
/**
* Gets the classification property value. The specification for the incident. The possible values are: unknown, falsePositive, truePositive, informationalExpectedActivity, unknownFutureValue.
* @return AlertClassification|null
*/
public function getClassification(): ?AlertClassification {
$val = $this->getBackingStore()->get('classification');
if (is_null($val) || $val instanceof AlertClassification) {
return $val;
}
throw new \UnexpectedValueException("Invalid type found in backing store for 'classification'");
}
/**
* Gets the comments property value. Array of comments created by the Security Operations (SecOps) team when the incident is managed.
* @return array<AlertComment>|null
*/
public function getComments(): ?array {
$val = $this->getBackingStore()->get('comments');
if (is_array($val) || is_null($val)) {
TypeUtils::validateCollectionValues($val, AlertComment::class);
/** @var array<AlertComment>|null $val */
return $val;
}
throw new \UnexpectedValueException("Invalid type found in backing store for 'comments'");
}
/**
* Gets the createdDateTime property value. Time when the incident was first created.
* @return DateTime|null
*/
public function getCreatedDateTime(): ?DateTime {
$val = $this->getBackingStore()->get('createdDateTime');
if (is_null($val) || $val instanceof DateTime) {
return $val;
}
throw new \UnexpectedValueException("Invalid type found in backing store for 'createdDateTime'");
}
/**
* Gets the customTags property value. Array of custom tags associated with an incident.
* @return array<string>|null
*/
public function getCustomTags(): ?array {
$val = $this->getBackingStore()->get('customTags');
if (is_array($val) || is_null($val)) {
TypeUtils::validateCollectionValues($val, 'string');
/** @var array<string>|null $val */
return $val;
}
throw new \UnexpectedValueException("Invalid type found in backing store for 'customTags'");
}
/**
* Gets the description property value. Description of the incident.
* @return string|null
*/
public function getDescription(): ?string {
$val = $this->getBackingStore()->get('description');
if (is_null($val) || is_string($val)) {
return $val;
}
throw new \UnexpectedValueException("Invalid type found in backing store for 'description'");
}
/**
* Gets the determination property value. Specifies the determination of the incident. The possible values are: unknown, apt, malware, securityPersonnel, securityTesting, unwantedSoftware, other, multiStagedAttack, compromisedUser, phishing, maliciousUserActivity, clean, insufficientData, confirmedUserActivity, lineOfBusinessApplication, unknownFutureValue.
* @return AlertDetermination|null
*/
public function getDetermination(): ?AlertDetermination {
$val = $this->getBackingStore()->get('determination');
if (is_null($val) || $val instanceof AlertDetermination) {
return $val;
}
throw new \UnexpectedValueException("Invalid type found in backing store for 'determination'");
}
/**
* Gets the displayName property value. The incident name.
* @return string|null
*/
public function getDisplayName(): ?string {
$val = $this->getBackingStore()->get('displayName');
if (is_null($val) || is_string($val)) {
return $val;
}
throw new \UnexpectedValueException("Invalid type found in backing store for 'displayName'");
}
/**
* The deserialization information for the current model
* @return array<string, callable(ParseNode): void>
*/
public function getFieldDeserializers(): array {
$o = $this;
return array_merge(parent::getFieldDeserializers(), [
'alerts' => fn(ParseNode $n) => $o->setAlerts($n->getCollectionOfObjectValues([Alert::class, 'createFromDiscriminatorValue'])),
'assignedTo' => fn(ParseNode $n) => $o->setAssignedTo($n->getStringValue()),
'classification' => fn(ParseNode $n) => $o->setClassification($n->getEnumValue(AlertClassification::class)),
'comments' => fn(ParseNode $n) => $o->setComments($n->getCollectionOfObjectValues([AlertComment::class, 'createFromDiscriminatorValue'])),
'createdDateTime' => fn(ParseNode $n) => $o->setCreatedDateTime($n->getDateTimeValue()),
'customTags' => function (ParseNode $n) {
$val = $n->getCollectionOfPrimitiveValues();
if (is_array($val)) {
TypeUtils::validateCollectionValues($val, 'string');
}
/** @var array<string>|null $val */
$this->setCustomTags($val);
},
'description' => fn(ParseNode $n) => $o->setDescription($n->getStringValue()),
'determination' => fn(ParseNode $n) => $o->setDetermination($n->getEnumValue(AlertDetermination::class)),
'displayName' => fn(ParseNode $n) => $o->setDisplayName($n->getStringValue()),
'incidentWebUrl' => fn(ParseNode $n) => $o->setIncidentWebUrl($n->getStringValue()),
'lastModifiedBy' => fn(ParseNode $n) => $o->setLastModifiedBy($n->getStringValue()),
'lastUpdateDateTime' => fn(ParseNode $n) => $o->setLastUpdateDateTime($n->getDateTimeValue()),
'priorityScore' => fn(ParseNode $n) => $o->setPriorityScore($n->getIntegerValue()),
'redirectIncidentId' => fn(ParseNode $n) => $o->setRedirectIncidentId($n->getStringValue()),
'resolvingComment' => fn(ParseNode $n) => $o->setResolvingComment($n->getStringValue()),
'severity' => fn(ParseNode $n) => $o->setSeverity($n->getEnumValue(AlertSeverity::class)),
'status' => fn(ParseNode $n) => $o->setStatus($n->getEnumValue(IncidentStatus::class)),
'summary' => fn(ParseNode $n) => $o->setSummary($n->getStringValue()),
'systemTags' => function (ParseNode $n) {
$val = $n->getCollectionOfPrimitiveValues();
if (is_array($val)) {
TypeUtils::validateCollectionValues($val, 'string');
}
/** @var array<string>|null $val */
$this->setSystemTags($val);
},
'tenantId' => fn(ParseNode $n) => $o->setTenantId($n->getStringValue()),
]);
}
/**
* Gets the incidentWebUrl property value. The URL for the incident page in the Microsoft 365 Defender portal.
* @return string|null
*/
public function getIncidentWebUrl(): ?string {
$val = $this->getBackingStore()->get('incidentWebUrl');
if (is_null($val) || is_string($val)) {
return $val;
}
throw new \UnexpectedValueException("Invalid type found in backing store for 'incidentWebUrl'");
}
/**
* Gets the lastModifiedBy property value. The identity that last modified the incident.
* @return string|null
*/
public function getLastModifiedBy(): ?string {
$val = $this->getBackingStore()->get('lastModifiedBy');
if (is_null($val) || is_string($val)) {
return $val;
}
throw new \UnexpectedValueException("Invalid type found in backing store for 'lastModifiedBy'");
}
/**
* Gets the lastUpdateDateTime property value. Time when the incident was last updated.
* @return DateTime|null
*/
public function getLastUpdateDateTime(): ?DateTime {
$val = $this->getBackingStore()->get('lastUpdateDateTime');
if (is_null($val) || $val instanceof DateTime) {
return $val;
}
throw new \UnexpectedValueException("Invalid type found in backing store for 'lastUpdateDateTime'");
}
/**
* Gets the priorityScore property value. The priorityScore property
* @return int|null
*/
public function getPriorityScore(): ?int {
$val = $this->getBackingStore()->get('priorityScore');
if (is_null($val) || is_int($val)) {
return $val;
}
throw new \UnexpectedValueException("Invalid type found in backing store for 'priorityScore'");
}
/**
* Gets the redirectIncidentId property value. Only populated in case an incident is grouped with another incident, as part of the logic that processes incidents. In such a case, the status property is redirected.
* @return string|null
*/
public function getRedirectIncidentId(): ?string {
$val = $this->getBackingStore()->get('redirectIncidentId');
if (is_null($val) || is_string($val)) {
return $val;
}
throw new \UnexpectedValueException("Invalid type found in backing store for 'redirectIncidentId'");
}
/**
* Gets the resolvingComment property value. User input that explains the resolution of the incident and the classification choice. This property contains free editable text.
* @return string|null
*/
public function getResolvingComment(): ?string {
$val = $this->getBackingStore()->get('resolvingComment');
if (is_null($val) || is_string($val)) {
return $val;
}
throw new \UnexpectedValueException("Invalid type found in backing store for 'resolvingComment'");
}
/**
* Gets the severity property value. The severity property
* @return AlertSeverity|null
*/
public function getSeverity(): ?AlertSeverity {
$val = $this->getBackingStore()->get('severity');
if (is_null($val) || $val instanceof AlertSeverity) {
return $val;
}
throw new \UnexpectedValueException("Invalid type found in backing store for 'severity'");
}
/**
* Gets the status property value. The status property
* @return IncidentStatus|null
*/
public function getStatus(): ?IncidentStatus {
$val = $this->getBackingStore()->get('status');
if (is_null($val) || $val instanceof IncidentStatus) {
return $val;
}
throw new \UnexpectedValueException("Invalid type found in backing store for 'status'");
}
/**
* Gets the summary property value. The overview of an attack. When applicable, the summary contains details of what occurred, impacted assets, and the type of attack.
* @return string|null
*/
public function getSummary(): ?string {
$val = $this->getBackingStore()->get('summary');
if (is_null($val) || is_string($val)) {
return $val;
}
throw new \UnexpectedValueException("Invalid type found in backing store for 'summary'");
}
/**
* Gets the systemTags property value. The system tags associated with the incident.
* @return array<string>|null
*/
public function getSystemTags(): ?array {
$val = $this->getBackingStore()->get('systemTags');
if (is_array($val) || is_null($val)) {
TypeUtils::validateCollectionValues($val, 'string');
/** @var array<string>|null $val */
return $val;
}
throw new \UnexpectedValueException("Invalid type found in backing store for 'systemTags'");
}
/**
* Gets the tenantId property value. The Microsoft Entra tenant in which the alert was created.
* @return string|null
*/
public function getTenantId(): ?string {
$val = $this->getBackingStore()->get('tenantId');
if (is_null($val) || is_string($val)) {
return $val;
}
throw new \UnexpectedValueException("Invalid type found in backing store for 'tenantId'");
}
/**
* Serializes information the current object
* @param SerializationWriter $writer Serialization writer to use to serialize this model
*/
public function serialize(SerializationWriter $writer): void {
parent::serialize($writer);
$writer->writeCollectionOfObjectValues('alerts', $this->getAlerts());
$writer->writeStringValue('assignedTo', $this->getAssignedTo());
$writer->writeEnumValue('classification', $this->getClassification());
$writer->writeCollectionOfObjectValues('comments', $this->getComments());
$writer->writeDateTimeValue('createdDateTime', $this->getCreatedDateTime());
$writer->writeCollectionOfPrimitiveValues('customTags', $this->getCustomTags());
$writer->writeStringValue('description', $this->getDescription());
$writer->writeEnumValue('determination', $this->getDetermination());
$writer->writeStringValue('displayName', $this->getDisplayName());
$writer->writeStringValue('incidentWebUrl', $this->getIncidentWebUrl());
$writer->writeStringValue('lastModifiedBy', $this->getLastModifiedBy());
$writer->writeDateTimeValue('lastUpdateDateTime', $this->getLastUpdateDateTime());
$writer->writeIntegerValue('priorityScore', $this->getPriorityScore());
$writer->writeStringValue('redirectIncidentId', $this->getRedirectIncidentId());
$writer->writeStringValue('resolvingComment', $this->getResolvingComment());
$writer->writeEnumValue('severity', $this->getSeverity());
$writer->writeEnumValue('status', $this->getStatus());
$writer->writeStringValue('summary', $this->getSummary());
$writer->writeCollectionOfPrimitiveValues('systemTags', $this->getSystemTags());
$writer->writeStringValue('tenantId', $this->getTenantId());
}
/**
* Sets the alerts property value. The list of related alerts. Supports $expand.
* @param array<Alert>|null $value Value to set for the alerts property.
*/
public function setAlerts(?array $value): void {
$this->getBackingStore()->set('alerts', $value);
}
/**
* Sets the assignedTo property value. Owner of the incident, or null if no owner is assigned. Free editable text.
* @param string|null $value Value to set for the assignedTo property.
*/
public function setAssignedTo(?string $value): void {
$this->getBackingStore()->set('assignedTo', $value);
}
/**
* Sets the classification property value. The specification for the incident. The possible values are: unknown, falsePositive, truePositive, informationalExpectedActivity, unknownFutureValue.
* @param AlertClassification|null $value Value to set for the classification property.
*/
public function setClassification(?AlertClassification $value): void {
$this->getBackingStore()->set('classification', $value);
}
/**
* Sets the comments property value. Array of comments created by the Security Operations (SecOps) team when the incident is managed.
* @param array<AlertComment>|null $value Value to set for the comments property.
*/
public function setComments(?array $value): void {
$this->getBackingStore()->set('comments', $value);
}
/**
* Sets the createdDateTime property value. Time when the incident was first created.
* @param DateTime|null $value Value to set for the createdDateTime property.
*/
public function setCreatedDateTime(?DateTime $value): void {
$this->getBackingStore()->set('createdDateTime', $value);
}
/**
* Sets the customTags property value. Array of custom tags associated with an incident.
* @param array<string>|null $value Value to set for the customTags property.
*/
public function setCustomTags(?array $value): void {
$this->getBackingStore()->set('customTags', $value);
}
/**
* Sets the description property value. Description of the incident.
* @param string|null $value Value to set for the description property.
*/
public function setDescription(?string $value): void {
$this->getBackingStore()->set('description', $value);
}
/**
* Sets the determination property value. Specifies the determination of the incident. The possible values are: unknown, apt, malware, securityPersonnel, securityTesting, unwantedSoftware, other, multiStagedAttack, compromisedUser, phishing, maliciousUserActivity, clean, insufficientData, confirmedUserActivity, lineOfBusinessApplication, unknownFutureValue.
* @param AlertDetermination|null $value Value to set for the determination property.
*/
public function setDetermination(?AlertDetermination $value): void {
$this->getBackingStore()->set('determination', $value);
}
/**
* Sets the displayName property value. The incident name.
* @param string|null $value Value to set for the displayName property.
*/
public function setDisplayName(?string $value): void {
$this->getBackingStore()->set('displayName', $value);
}
/**
* Sets the incidentWebUrl property value. The URL for the incident page in the Microsoft 365 Defender portal.
* @param string|null $value Value to set for the incidentWebUrl property.
*/
public function setIncidentWebUrl(?string $value): void {
$this->getBackingStore()->set('incidentWebUrl', $value);
}
/**
* Sets the lastModifiedBy property value. The identity that last modified the incident.
* @param string|null $value Value to set for the lastModifiedBy property.
*/
public function setLastModifiedBy(?string $value): void {
$this->getBackingStore()->set('lastModifiedBy', $value);
}
/**
* Sets the lastUpdateDateTime property value. Time when the incident was last updated.
* @param DateTime|null $value Value to set for the lastUpdateDateTime property.
*/
public function setLastUpdateDateTime(?DateTime $value): void {
$this->getBackingStore()->set('lastUpdateDateTime', $value);
}
/**
* Sets the priorityScore property value. The priorityScore property
* @param int|null $value Value to set for the priorityScore property.
*/
public function setPriorityScore(?int $value): void {
$this->getBackingStore()->set('priorityScore', $value);
}
/**
* Sets the redirectIncidentId property value. Only populated in case an incident is grouped with another incident, as part of the logic that processes incidents. In such a case, the status property is redirected.
* @param string|null $value Value to set for the redirectIncidentId property.
*/
public function setRedirectIncidentId(?string $value): void {
$this->getBackingStore()->set('redirectIncidentId', $value);
}
/**
* Sets the resolvingComment property value. User input that explains the resolution of the incident and the classification choice. This property contains free editable text.
* @param string|null $value Value to set for the resolvingComment property.
*/
public function setResolvingComment(?string $value): void {
$this->getBackingStore()->set('resolvingComment', $value);
}
/**
* Sets the severity property value. The severity property
* @param AlertSeverity|null $value Value to set for the severity property.
*/
public function setSeverity(?AlertSeverity $value): void {
$this->getBackingStore()->set('severity', $value);
}
/**
* Sets the status property value. The status property
* @param IncidentStatus|null $value Value to set for the status property.
*/
public function setStatus(?IncidentStatus $value): void {
$this->getBackingStore()->set('status', $value);
}
/**
* Sets the summary property value. The overview of an attack. When applicable, the summary contains details of what occurred, impacted assets, and the type of attack.
* @param string|null $value Value to set for the summary property.
*/
public function setSummary(?string $value): void {
$this->getBackingStore()->set('summary', $value);
}
/**
* Sets the systemTags property value. The system tags associated with the incident.
* @param array<string>|null $value Value to set for the systemTags property.
*/
public function setSystemTags(?array $value): void {
$this->getBackingStore()->set('systemTags', $value);
}
/**
* Sets the tenantId property value. The Microsoft Entra tenant in which the alert was created.
* @param string|null $value Value to set for the tenantId property.
*/
public function setTenantId(?string $value): void {
$this->getBackingStore()->set('tenantId', $value);
}
}