-
Notifications
You must be signed in to change notification settings - Fork 2
/
model_model_vulnerability_rule.go
592 lines (495 loc) · 15.5 KB
/
model_model_vulnerability_rule.go
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
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
/*
Kengine ThreatMapper
Kengine Runtime API provides programmatic control over Kengine microservice securing your container, kubernetes and cloud deployments. The API abstracts away underlying infrastructure details like cloud provider, container distros, container orchestrator and type of deployment. This is one uniform API to manage and control security alerts, policies and response to alerts for microservices running anywhere i.e. managed pure greenfield container deployments or a mix of containers, VMs and serverless paradigms like AWS Fargate.
API version: 2.2.0
Contact: community@kengine.io
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package client
import (
"encoding/json"
"bytes"
"fmt"
)
// checks if the ModelVulnerabilityRule type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ModelVulnerabilityRule{}
// ModelVulnerabilityRule struct for ModelVulnerabilityRule
type ModelVulnerabilityRule struct {
CveAttackVector string `json:"cve_attack_vector"`
CveCvssScore float32 `json:"cve_cvss_score"`
CveDescription string `json:"cve_description"`
CveFixedIn string `json:"cve_fixed_in"`
CveId string `json:"cve_id"`
CveLink string `json:"cve_link"`
CveOverallScore float32 `json:"cve_overall_score"`
CveSeverity string `json:"cve_severity"`
CveType string `json:"cve_type"`
ExploitPoc string `json:"exploit_poc"`
Masked bool `json:"masked"`
NodeId string `json:"node_id"`
ParsedAttackVector string `json:"parsed_attack_vector"`
Resources []ModelBasicNode `json:"resources,omitempty"`
UpdatedAt int32 `json:"updated_at"`
Urls []interface{} `json:"urls"`
}
type _ModelVulnerabilityRule ModelVulnerabilityRule
// NewModelVulnerabilityRule instantiates a new ModelVulnerabilityRule object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewModelVulnerabilityRule(cveAttackVector string, cveCvssScore float32, cveDescription string, cveFixedIn string, cveId string, cveLink string, cveOverallScore float32, cveSeverity string, cveType string, exploitPoc string, masked bool, nodeId string, parsedAttackVector string, updatedAt int32, urls []interface{}) *ModelVulnerabilityRule {
this := ModelVulnerabilityRule{}
this.CveAttackVector = cveAttackVector
this.CveCvssScore = cveCvssScore
this.CveDescription = cveDescription
this.CveFixedIn = cveFixedIn
this.CveId = cveId
this.CveLink = cveLink
this.CveOverallScore = cveOverallScore
this.CveSeverity = cveSeverity
this.CveType = cveType
this.ExploitPoc = exploitPoc
this.Masked = masked
this.NodeId = nodeId
this.ParsedAttackVector = parsedAttackVector
this.UpdatedAt = updatedAt
this.Urls = urls
return &this
}
// NewModelVulnerabilityRuleWithDefaults instantiates a new ModelVulnerabilityRule object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewModelVulnerabilityRuleWithDefaults() *ModelVulnerabilityRule {
this := ModelVulnerabilityRule{}
return &this
}
// GetCveAttackVector returns the CveAttackVector field value
func (o *ModelVulnerabilityRule) GetCveAttackVector() string {
if o == nil {
var ret string
return ret
}
return o.CveAttackVector
}
// GetCveAttackVectorOk returns a tuple with the CveAttackVector field value
// and a boolean to check if the value has been set.
func (o *ModelVulnerabilityRule) GetCveAttackVectorOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.CveAttackVector, true
}
// SetCveAttackVector sets field value
func (o *ModelVulnerabilityRule) SetCveAttackVector(v string) {
o.CveAttackVector = v
}
// GetCveCvssScore returns the CveCvssScore field value
func (o *ModelVulnerabilityRule) GetCveCvssScore() float32 {
if o == nil {
var ret float32
return ret
}
return o.CveCvssScore
}
// GetCveCvssScoreOk returns a tuple with the CveCvssScore field value
// and a boolean to check if the value has been set.
func (o *ModelVulnerabilityRule) GetCveCvssScoreOk() (*float32, bool) {
if o == nil {
return nil, false
}
return &o.CveCvssScore, true
}
// SetCveCvssScore sets field value
func (o *ModelVulnerabilityRule) SetCveCvssScore(v float32) {
o.CveCvssScore = v
}
// GetCveDescription returns the CveDescription field value
func (o *ModelVulnerabilityRule) GetCveDescription() string {
if o == nil {
var ret string
return ret
}
return o.CveDescription
}
// GetCveDescriptionOk returns a tuple with the CveDescription field value
// and a boolean to check if the value has been set.
func (o *ModelVulnerabilityRule) GetCveDescriptionOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.CveDescription, true
}
// SetCveDescription sets field value
func (o *ModelVulnerabilityRule) SetCveDescription(v string) {
o.CveDescription = v
}
// GetCveFixedIn returns the CveFixedIn field value
func (o *ModelVulnerabilityRule) GetCveFixedIn() string {
if o == nil {
var ret string
return ret
}
return o.CveFixedIn
}
// GetCveFixedInOk returns a tuple with the CveFixedIn field value
// and a boolean to check if the value has been set.
func (o *ModelVulnerabilityRule) GetCveFixedInOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.CveFixedIn, true
}
// SetCveFixedIn sets field value
func (o *ModelVulnerabilityRule) SetCveFixedIn(v string) {
o.CveFixedIn = v
}
// GetCveId returns the CveId field value
func (o *ModelVulnerabilityRule) GetCveId() string {
if o == nil {
var ret string
return ret
}
return o.CveId
}
// GetCveIdOk returns a tuple with the CveId field value
// and a boolean to check if the value has been set.
func (o *ModelVulnerabilityRule) GetCveIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.CveId, true
}
// SetCveId sets field value
func (o *ModelVulnerabilityRule) SetCveId(v string) {
o.CveId = v
}
// GetCveLink returns the CveLink field value
func (o *ModelVulnerabilityRule) GetCveLink() string {
if o == nil {
var ret string
return ret
}
return o.CveLink
}
// GetCveLinkOk returns a tuple with the CveLink field value
// and a boolean to check if the value has been set.
func (o *ModelVulnerabilityRule) GetCveLinkOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.CveLink, true
}
// SetCveLink sets field value
func (o *ModelVulnerabilityRule) SetCveLink(v string) {
o.CveLink = v
}
// GetCveOverallScore returns the CveOverallScore field value
func (o *ModelVulnerabilityRule) GetCveOverallScore() float32 {
if o == nil {
var ret float32
return ret
}
return o.CveOverallScore
}
// GetCveOverallScoreOk returns a tuple with the CveOverallScore field value
// and a boolean to check if the value has been set.
func (o *ModelVulnerabilityRule) GetCveOverallScoreOk() (*float32, bool) {
if o == nil {
return nil, false
}
return &o.CveOverallScore, true
}
// SetCveOverallScore sets field value
func (o *ModelVulnerabilityRule) SetCveOverallScore(v float32) {
o.CveOverallScore = v
}
// GetCveSeverity returns the CveSeverity field value
func (o *ModelVulnerabilityRule) GetCveSeverity() string {
if o == nil {
var ret string
return ret
}
return o.CveSeverity
}
// GetCveSeverityOk returns a tuple with the CveSeverity field value
// and a boolean to check if the value has been set.
func (o *ModelVulnerabilityRule) GetCveSeverityOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.CveSeverity, true
}
// SetCveSeverity sets field value
func (o *ModelVulnerabilityRule) SetCveSeverity(v string) {
o.CveSeverity = v
}
// GetCveType returns the CveType field value
func (o *ModelVulnerabilityRule) GetCveType() string {
if o == nil {
var ret string
return ret
}
return o.CveType
}
// GetCveTypeOk returns a tuple with the CveType field value
// and a boolean to check if the value has been set.
func (o *ModelVulnerabilityRule) GetCveTypeOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.CveType, true
}
// SetCveType sets field value
func (o *ModelVulnerabilityRule) SetCveType(v string) {
o.CveType = v
}
// GetExploitPoc returns the ExploitPoc field value
func (o *ModelVulnerabilityRule) GetExploitPoc() string {
if o == nil {
var ret string
return ret
}
return o.ExploitPoc
}
// GetExploitPocOk returns a tuple with the ExploitPoc field value
// and a boolean to check if the value has been set.
func (o *ModelVulnerabilityRule) GetExploitPocOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.ExploitPoc, true
}
// SetExploitPoc sets field value
func (o *ModelVulnerabilityRule) SetExploitPoc(v string) {
o.ExploitPoc = v
}
// GetMasked returns the Masked field value
func (o *ModelVulnerabilityRule) GetMasked() bool {
if o == nil {
var ret bool
return ret
}
return o.Masked
}
// GetMaskedOk returns a tuple with the Masked field value
// and a boolean to check if the value has been set.
func (o *ModelVulnerabilityRule) GetMaskedOk() (*bool, bool) {
if o == nil {
return nil, false
}
return &o.Masked, true
}
// SetMasked sets field value
func (o *ModelVulnerabilityRule) SetMasked(v bool) {
o.Masked = v
}
// GetNodeId returns the NodeId field value
func (o *ModelVulnerabilityRule) GetNodeId() string {
if o == nil {
var ret string
return ret
}
return o.NodeId
}
// GetNodeIdOk returns a tuple with the NodeId field value
// and a boolean to check if the value has been set.
func (o *ModelVulnerabilityRule) GetNodeIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.NodeId, true
}
// SetNodeId sets field value
func (o *ModelVulnerabilityRule) SetNodeId(v string) {
o.NodeId = v
}
// GetParsedAttackVector returns the ParsedAttackVector field value
func (o *ModelVulnerabilityRule) GetParsedAttackVector() string {
if o == nil {
var ret string
return ret
}
return o.ParsedAttackVector
}
// GetParsedAttackVectorOk returns a tuple with the ParsedAttackVector field value
// and a boolean to check if the value has been set.
func (o *ModelVulnerabilityRule) GetParsedAttackVectorOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.ParsedAttackVector, true
}
// SetParsedAttackVector sets field value
func (o *ModelVulnerabilityRule) SetParsedAttackVector(v string) {
o.ParsedAttackVector = v
}
// GetResources returns the Resources field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *ModelVulnerabilityRule) GetResources() []ModelBasicNode {
if o == nil {
var ret []ModelBasicNode
return ret
}
return o.Resources
}
// GetResourcesOk returns a tuple with the Resources field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *ModelVulnerabilityRule) GetResourcesOk() ([]ModelBasicNode, bool) {
if o == nil || IsNil(o.Resources) {
return nil, false
}
return o.Resources, true
}
// HasResources returns a boolean if a field has been set.
func (o *ModelVulnerabilityRule) HasResources() bool {
if o != nil && !IsNil(o.Resources) {
return true
}
return false
}
// SetResources gets a reference to the given []ModelBasicNode and assigns it to the Resources field.
func (o *ModelVulnerabilityRule) SetResources(v []ModelBasicNode) {
o.Resources = v
}
// GetUpdatedAt returns the UpdatedAt field value
func (o *ModelVulnerabilityRule) GetUpdatedAt() int32 {
if o == nil {
var ret int32
return ret
}
return o.UpdatedAt
}
// GetUpdatedAtOk returns a tuple with the UpdatedAt field value
// and a boolean to check if the value has been set.
func (o *ModelVulnerabilityRule) GetUpdatedAtOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.UpdatedAt, true
}
// SetUpdatedAt sets field value
func (o *ModelVulnerabilityRule) SetUpdatedAt(v int32) {
o.UpdatedAt = v
}
// GetUrls returns the Urls field value
// If the value is explicit nil, the zero value for []interface{} will be returned
func (o *ModelVulnerabilityRule) GetUrls() []interface{} {
if o == nil {
var ret []interface{}
return ret
}
return o.Urls
}
// GetUrlsOk returns a tuple with the Urls field value
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *ModelVulnerabilityRule) GetUrlsOk() ([]interface{}, bool) {
if o == nil || IsNil(o.Urls) {
return nil, false
}
return o.Urls, true
}
// SetUrls sets field value
func (o *ModelVulnerabilityRule) SetUrls(v []interface{}) {
o.Urls = v
}
func (o ModelVulnerabilityRule) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ModelVulnerabilityRule) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["cve_attack_vector"] = o.CveAttackVector
toSerialize["cve_cvss_score"] = o.CveCvssScore
toSerialize["cve_description"] = o.CveDescription
toSerialize["cve_fixed_in"] = o.CveFixedIn
toSerialize["cve_id"] = o.CveId
toSerialize["cve_link"] = o.CveLink
toSerialize["cve_overall_score"] = o.CveOverallScore
toSerialize["cve_severity"] = o.CveSeverity
toSerialize["cve_type"] = o.CveType
toSerialize["exploit_poc"] = o.ExploitPoc
toSerialize["masked"] = o.Masked
toSerialize["node_id"] = o.NodeId
toSerialize["parsed_attack_vector"] = o.ParsedAttackVector
if o.Resources != nil {
toSerialize["resources"] = o.Resources
}
toSerialize["updated_at"] = o.UpdatedAt
if o.Urls != nil {
toSerialize["urls"] = o.Urls
}
return toSerialize, nil
}
func (o *ModelVulnerabilityRule) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"cve_attack_vector",
"cve_cvss_score",
"cve_description",
"cve_fixed_in",
"cve_id",
"cve_link",
"cve_overall_score",
"cve_severity",
"cve_type",
"exploit_poc",
"masked",
"node_id",
"parsed_attack_vector",
"updated_at",
"urls",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varModelVulnerabilityRule := _ModelVulnerabilityRule{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varModelVulnerabilityRule)
if err != nil {
return err
}
*o = ModelVulnerabilityRule(varModelVulnerabilityRule)
return err
}
type NullableModelVulnerabilityRule struct {
value *ModelVulnerabilityRule
isSet bool
}
func (v NullableModelVulnerabilityRule) Get() *ModelVulnerabilityRule {
return v.value
}
func (v *NullableModelVulnerabilityRule) Set(val *ModelVulnerabilityRule) {
v.value = val
v.isSet = true
}
func (v NullableModelVulnerabilityRule) IsSet() bool {
return v.isSet
}
func (v *NullableModelVulnerabilityRule) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableModelVulnerabilityRule(val *ModelVulnerabilityRule) *NullableModelVulnerabilityRule {
return &NullableModelVulnerabilityRule{value: val, isSet: true}
}
func (v NullableModelVulnerabilityRule) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableModelVulnerabilityRule) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}