/
model_model_malware.go
745 lines (627 loc) · 18.8 KB
/
model_model_malware.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
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
/*
Deepfence ThreatMapper
Deepfence Runtime API provides programmatic control over Deepfence 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@deepfence.io
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package client
import (
"encoding/json"
"bytes"
"fmt"
)
// checks if the ModelMalware type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ModelMalware{}
// ModelMalware struct for ModelMalware
type ModelMalware struct {
Author *string `json:"author,omitempty"`
Class string `json:"class"`
CompleteFilename string `json:"complete_filename"`
Date *string `json:"date,omitempty"`
Description *string `json:"description,omitempty"`
FileSevScore int32 `json:"file_sev_score"`
FileSeverity string `json:"file_severity"`
Filetype *string `json:"filetype,omitempty"`
ImageLayerId string `json:"image_layer_id"`
Info *string `json:"info,omitempty"`
Masked bool `json:"masked"`
NodeId string `json:"node_id"`
Resources []ModelBasicNode `json:"resources,omitempty"`
RuleId string `json:"rule_id"`
RuleName string `json:"rule_name"`
SeverityScore *int32 `json:"severity_score,omitempty"`
StringsToMatch []interface{} `json:"strings_to_match,omitempty"`
Summary *string `json:"summary,omitempty"`
Version *string `json:"version,omitempty"`
}
type _ModelMalware ModelMalware
// NewModelMalware instantiates a new ModelMalware 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 NewModelMalware(class string, completeFilename string, fileSevScore int32, fileSeverity string, imageLayerId string, masked bool, nodeId string, ruleId string, ruleName string) *ModelMalware {
this := ModelMalware{}
this.Class = class
this.CompleteFilename = completeFilename
this.FileSevScore = fileSevScore
this.FileSeverity = fileSeverity
this.ImageLayerId = imageLayerId
this.Masked = masked
this.NodeId = nodeId
this.RuleId = ruleId
this.RuleName = ruleName
return &this
}
// NewModelMalwareWithDefaults instantiates a new ModelMalware 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 NewModelMalwareWithDefaults() *ModelMalware {
this := ModelMalware{}
return &this
}
// GetAuthor returns the Author field value if set, zero value otherwise.
func (o *ModelMalware) GetAuthor() string {
if o == nil || IsNil(o.Author) {
var ret string
return ret
}
return *o.Author
}
// GetAuthorOk returns a tuple with the Author field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ModelMalware) GetAuthorOk() (*string, bool) {
if o == nil || IsNil(o.Author) {
return nil, false
}
return o.Author, true
}
// HasAuthor returns a boolean if a field has been set.
func (o *ModelMalware) HasAuthor() bool {
if o != nil && !IsNil(o.Author) {
return true
}
return false
}
// SetAuthor gets a reference to the given string and assigns it to the Author field.
func (o *ModelMalware) SetAuthor(v string) {
o.Author = &v
}
// GetClass returns the Class field value
func (o *ModelMalware) GetClass() string {
if o == nil {
var ret string
return ret
}
return o.Class
}
// GetClassOk returns a tuple with the Class field value
// and a boolean to check if the value has been set.
func (o *ModelMalware) GetClassOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Class, true
}
// SetClass sets field value
func (o *ModelMalware) SetClass(v string) {
o.Class = v
}
// GetCompleteFilename returns the CompleteFilename field value
func (o *ModelMalware) GetCompleteFilename() string {
if o == nil {
var ret string
return ret
}
return o.CompleteFilename
}
// GetCompleteFilenameOk returns a tuple with the CompleteFilename field value
// and a boolean to check if the value has been set.
func (o *ModelMalware) GetCompleteFilenameOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.CompleteFilename, true
}
// SetCompleteFilename sets field value
func (o *ModelMalware) SetCompleteFilename(v string) {
o.CompleteFilename = v
}
// GetDate returns the Date field value if set, zero value otherwise.
func (o *ModelMalware) GetDate() string {
if o == nil || IsNil(o.Date) {
var ret string
return ret
}
return *o.Date
}
// GetDateOk returns a tuple with the Date field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ModelMalware) GetDateOk() (*string, bool) {
if o == nil || IsNil(o.Date) {
return nil, false
}
return o.Date, true
}
// HasDate returns a boolean if a field has been set.
func (o *ModelMalware) HasDate() bool {
if o != nil && !IsNil(o.Date) {
return true
}
return false
}
// SetDate gets a reference to the given string and assigns it to the Date field.
func (o *ModelMalware) SetDate(v string) {
o.Date = &v
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *ModelMalware) GetDescription() string {
if o == nil || IsNil(o.Description) {
var ret string
return ret
}
return *o.Description
}
// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ModelMalware) GetDescriptionOk() (*string, bool) {
if o == nil || IsNil(o.Description) {
return nil, false
}
return o.Description, true
}
// HasDescription returns a boolean if a field has been set.
func (o *ModelMalware) HasDescription() bool {
if o != nil && !IsNil(o.Description) {
return true
}
return false
}
// SetDescription gets a reference to the given string and assigns it to the Description field.
func (o *ModelMalware) SetDescription(v string) {
o.Description = &v
}
// GetFileSevScore returns the FileSevScore field value
func (o *ModelMalware) GetFileSevScore() int32 {
if o == nil {
var ret int32
return ret
}
return o.FileSevScore
}
// GetFileSevScoreOk returns a tuple with the FileSevScore field value
// and a boolean to check if the value has been set.
func (o *ModelMalware) GetFileSevScoreOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.FileSevScore, true
}
// SetFileSevScore sets field value
func (o *ModelMalware) SetFileSevScore(v int32) {
o.FileSevScore = v
}
// GetFileSeverity returns the FileSeverity field value
func (o *ModelMalware) GetFileSeverity() string {
if o == nil {
var ret string
return ret
}
return o.FileSeverity
}
// GetFileSeverityOk returns a tuple with the FileSeverity field value
// and a boolean to check if the value has been set.
func (o *ModelMalware) GetFileSeverityOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.FileSeverity, true
}
// SetFileSeverity sets field value
func (o *ModelMalware) SetFileSeverity(v string) {
o.FileSeverity = v
}
// GetFiletype returns the Filetype field value if set, zero value otherwise.
func (o *ModelMalware) GetFiletype() string {
if o == nil || IsNil(o.Filetype) {
var ret string
return ret
}
return *o.Filetype
}
// GetFiletypeOk returns a tuple with the Filetype field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ModelMalware) GetFiletypeOk() (*string, bool) {
if o == nil || IsNil(o.Filetype) {
return nil, false
}
return o.Filetype, true
}
// HasFiletype returns a boolean if a field has been set.
func (o *ModelMalware) HasFiletype() bool {
if o != nil && !IsNil(o.Filetype) {
return true
}
return false
}
// SetFiletype gets a reference to the given string and assigns it to the Filetype field.
func (o *ModelMalware) SetFiletype(v string) {
o.Filetype = &v
}
// GetImageLayerId returns the ImageLayerId field value
func (o *ModelMalware) GetImageLayerId() string {
if o == nil {
var ret string
return ret
}
return o.ImageLayerId
}
// GetImageLayerIdOk returns a tuple with the ImageLayerId field value
// and a boolean to check if the value has been set.
func (o *ModelMalware) GetImageLayerIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.ImageLayerId, true
}
// SetImageLayerId sets field value
func (o *ModelMalware) SetImageLayerId(v string) {
o.ImageLayerId = v
}
// GetInfo returns the Info field value if set, zero value otherwise.
func (o *ModelMalware) GetInfo() string {
if o == nil || IsNil(o.Info) {
var ret string
return ret
}
return *o.Info
}
// GetInfoOk returns a tuple with the Info field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ModelMalware) GetInfoOk() (*string, bool) {
if o == nil || IsNil(o.Info) {
return nil, false
}
return o.Info, true
}
// HasInfo returns a boolean if a field has been set.
func (o *ModelMalware) HasInfo() bool {
if o != nil && !IsNil(o.Info) {
return true
}
return false
}
// SetInfo gets a reference to the given string and assigns it to the Info field.
func (o *ModelMalware) SetInfo(v string) {
o.Info = &v
}
// GetMasked returns the Masked field value
func (o *ModelMalware) 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 *ModelMalware) GetMaskedOk() (*bool, bool) {
if o == nil {
return nil, false
}
return &o.Masked, true
}
// SetMasked sets field value
func (o *ModelMalware) SetMasked(v bool) {
o.Masked = v
}
// GetNodeId returns the NodeId field value
func (o *ModelMalware) 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 *ModelMalware) GetNodeIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.NodeId, true
}
// SetNodeId sets field value
func (o *ModelMalware) SetNodeId(v string) {
o.NodeId = v
}
// GetResources returns the Resources field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *ModelMalware) 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 *ModelMalware) 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 *ModelMalware) 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 *ModelMalware) SetResources(v []ModelBasicNode) {
o.Resources = v
}
// GetRuleId returns the RuleId field value
func (o *ModelMalware) GetRuleId() string {
if o == nil {
var ret string
return ret
}
return o.RuleId
}
// GetRuleIdOk returns a tuple with the RuleId field value
// and a boolean to check if the value has been set.
func (o *ModelMalware) GetRuleIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.RuleId, true
}
// SetRuleId sets field value
func (o *ModelMalware) SetRuleId(v string) {
o.RuleId = v
}
// GetRuleName returns the RuleName field value
func (o *ModelMalware) GetRuleName() string {
if o == nil {
var ret string
return ret
}
return o.RuleName
}
// GetRuleNameOk returns a tuple with the RuleName field value
// and a boolean to check if the value has been set.
func (o *ModelMalware) GetRuleNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.RuleName, true
}
// SetRuleName sets field value
func (o *ModelMalware) SetRuleName(v string) {
o.RuleName = v
}
// GetSeverityScore returns the SeverityScore field value if set, zero value otherwise.
func (o *ModelMalware) GetSeverityScore() int32 {
if o == nil || IsNil(o.SeverityScore) {
var ret int32
return ret
}
return *o.SeverityScore
}
// GetSeverityScoreOk returns a tuple with the SeverityScore field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ModelMalware) GetSeverityScoreOk() (*int32, bool) {
if o == nil || IsNil(o.SeverityScore) {
return nil, false
}
return o.SeverityScore, true
}
// HasSeverityScore returns a boolean if a field has been set.
func (o *ModelMalware) HasSeverityScore() bool {
if o != nil && !IsNil(o.SeverityScore) {
return true
}
return false
}
// SetSeverityScore gets a reference to the given int32 and assigns it to the SeverityScore field.
func (o *ModelMalware) SetSeverityScore(v int32) {
o.SeverityScore = &v
}
// GetStringsToMatch returns the StringsToMatch field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *ModelMalware) GetStringsToMatch() []interface{} {
if o == nil {
var ret []interface{}
return ret
}
return o.StringsToMatch
}
// GetStringsToMatchOk returns a tuple with the StringsToMatch 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 *ModelMalware) GetStringsToMatchOk() ([]interface{}, bool) {
if o == nil || IsNil(o.StringsToMatch) {
return nil, false
}
return o.StringsToMatch, true
}
// HasStringsToMatch returns a boolean if a field has been set.
func (o *ModelMalware) HasStringsToMatch() bool {
if o != nil && !IsNil(o.StringsToMatch) {
return true
}
return false
}
// SetStringsToMatch gets a reference to the given []interface{} and assigns it to the StringsToMatch field.
func (o *ModelMalware) SetStringsToMatch(v []interface{}) {
o.StringsToMatch = v
}
// GetSummary returns the Summary field value if set, zero value otherwise.
func (o *ModelMalware) GetSummary() string {
if o == nil || IsNil(o.Summary) {
var ret string
return ret
}
return *o.Summary
}
// GetSummaryOk returns a tuple with the Summary field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ModelMalware) GetSummaryOk() (*string, bool) {
if o == nil || IsNil(o.Summary) {
return nil, false
}
return o.Summary, true
}
// HasSummary returns a boolean if a field has been set.
func (o *ModelMalware) HasSummary() bool {
if o != nil && !IsNil(o.Summary) {
return true
}
return false
}
// SetSummary gets a reference to the given string and assigns it to the Summary field.
func (o *ModelMalware) SetSummary(v string) {
o.Summary = &v
}
// GetVersion returns the Version field value if set, zero value otherwise.
func (o *ModelMalware) GetVersion() string {
if o == nil || IsNil(o.Version) {
var ret string
return ret
}
return *o.Version
}
// GetVersionOk returns a tuple with the Version field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ModelMalware) GetVersionOk() (*string, bool) {
if o == nil || IsNil(o.Version) {
return nil, false
}
return o.Version, true
}
// HasVersion returns a boolean if a field has been set.
func (o *ModelMalware) HasVersion() bool {
if o != nil && !IsNil(o.Version) {
return true
}
return false
}
// SetVersion gets a reference to the given string and assigns it to the Version field.
func (o *ModelMalware) SetVersion(v string) {
o.Version = &v
}
func (o ModelMalware) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ModelMalware) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Author) {
toSerialize["author"] = o.Author
}
toSerialize["class"] = o.Class
toSerialize["complete_filename"] = o.CompleteFilename
if !IsNil(o.Date) {
toSerialize["date"] = o.Date
}
if !IsNil(o.Description) {
toSerialize["description"] = o.Description
}
toSerialize["file_sev_score"] = o.FileSevScore
toSerialize["file_severity"] = o.FileSeverity
if !IsNil(o.Filetype) {
toSerialize["filetype"] = o.Filetype
}
toSerialize["image_layer_id"] = o.ImageLayerId
if !IsNil(o.Info) {
toSerialize["info"] = o.Info
}
toSerialize["masked"] = o.Masked
toSerialize["node_id"] = o.NodeId
if o.Resources != nil {
toSerialize["resources"] = o.Resources
}
toSerialize["rule_id"] = o.RuleId
toSerialize["rule_name"] = o.RuleName
if !IsNil(o.SeverityScore) {
toSerialize["severity_score"] = o.SeverityScore
}
if o.StringsToMatch != nil {
toSerialize["strings_to_match"] = o.StringsToMatch
}
if !IsNil(o.Summary) {
toSerialize["summary"] = o.Summary
}
if !IsNil(o.Version) {
toSerialize["version"] = o.Version
}
return toSerialize, nil
}
func (o *ModelMalware) 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{
"class",
"complete_filename",
"file_sev_score",
"file_severity",
"image_layer_id",
"masked",
"node_id",
"rule_id",
"rule_name",
}
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)
}
}
varModelMalware := _ModelMalware{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varModelMalware)
if err != nil {
return err
}
*o = ModelMalware(varModelMalware)
return err
}
type NullableModelMalware struct {
value *ModelMalware
isSet bool
}
func (v NullableModelMalware) Get() *ModelMalware {
return v.value
}
func (v *NullableModelMalware) Set(val *ModelMalware) {
v.value = val
v.isSet = true
}
func (v NullableModelMalware) IsSet() bool {
return v.isSet
}
func (v *NullableModelMalware) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableModelMalware(val *ModelMalware) *NullableModelMalware {
return &NullableModelMalware{value: val, isSet: true}
}
func (v NullableModelMalware) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableModelMalware) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}