/
model_model_compliance.go
641 lines (536 loc) · 16.2 KB
/
model_model_compliance.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
/*
Toae ThreatMapper
Toae Runtime API provides programmatic control over Toae 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.0.0
Contact: toaedev@toaesecurity.com
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package client
import (
"encoding/json"
"fmt"
)
// checks if the ModelCompliance type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ModelCompliance{}
// ModelCompliance struct for ModelCompliance
type ModelCompliance struct {
ComplianceCheckType string `json:"compliance_check_type"`
Description string `json:"description"`
Masked bool `json:"masked"`
NodeId string `json:"node_id"`
NodeType string `json:"node_type"`
RemediationAnsible string `json:"remediation_ansible"`
RemediationPuppet string `json:"remediation_puppet"`
RemediationScript string `json:"remediation_script"`
Resource string `json:"resource"`
Resources []ModelBasicNode `json:"resources,omitempty"`
RuleId string `json:"rule_id"`
Status string `json:"status"`
TestCategory string `json:"test_category"`
TestDesc string `json:"test_desc"`
TestNumber string `json:"test_number"`
TestRationale string `json:"test_rationale"`
TestSeverity string `json:"test_severity"`
UpdatedAt int32 `json:"updated_at"`
}
type _ModelCompliance ModelCompliance
// NewModelCompliance instantiates a new ModelCompliance 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 NewModelCompliance(complianceCheckType string, description string, masked bool, nodeId string, nodeType string, remediationAnsible string, remediationPuppet string, remediationScript string, resource string, ruleId string, status string, testCategory string, testDesc string, testNumber string, testRationale string, testSeverity string, updatedAt int32) *ModelCompliance {
this := ModelCompliance{}
this.ComplianceCheckType = complianceCheckType
this.Description = description
this.Masked = masked
this.NodeId = nodeId
this.NodeType = nodeType
this.RemediationAnsible = remediationAnsible
this.RemediationPuppet = remediationPuppet
this.RemediationScript = remediationScript
this.Resource = resource
this.RuleId = ruleId
this.Status = status
this.TestCategory = testCategory
this.TestDesc = testDesc
this.TestNumber = testNumber
this.TestRationale = testRationale
this.TestSeverity = testSeverity
this.UpdatedAt = updatedAt
return &this
}
// NewModelComplianceWithDefaults instantiates a new ModelCompliance 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 NewModelComplianceWithDefaults() *ModelCompliance {
this := ModelCompliance{}
return &this
}
// GetComplianceCheckType returns the ComplianceCheckType field value
func (o *ModelCompliance) GetComplianceCheckType() string {
if o == nil {
var ret string
return ret
}
return o.ComplianceCheckType
}
// GetComplianceCheckTypeOk returns a tuple with the ComplianceCheckType field value
// and a boolean to check if the value has been set.
func (o *ModelCompliance) GetComplianceCheckTypeOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.ComplianceCheckType, true
}
// SetComplianceCheckType sets field value
func (o *ModelCompliance) SetComplianceCheckType(v string) {
o.ComplianceCheckType = v
}
// GetDescription returns the Description field value
func (o *ModelCompliance) GetDescription() string {
if o == nil {
var ret string
return ret
}
return o.Description
}
// GetDescriptionOk returns a tuple with the Description field value
// and a boolean to check if the value has been set.
func (o *ModelCompliance) GetDescriptionOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Description, true
}
// SetDescription sets field value
func (o *ModelCompliance) SetDescription(v string) {
o.Description = v
}
// GetMasked returns the Masked field value
func (o *ModelCompliance) 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 *ModelCompliance) GetMaskedOk() (*bool, bool) {
if o == nil {
return nil, false
}
return &o.Masked, true
}
// SetMasked sets field value
func (o *ModelCompliance) SetMasked(v bool) {
o.Masked = v
}
// GetNodeId returns the NodeId field value
func (o *ModelCompliance) 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 *ModelCompliance) GetNodeIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.NodeId, true
}
// SetNodeId sets field value
func (o *ModelCompliance) SetNodeId(v string) {
o.NodeId = v
}
// GetNodeType returns the NodeType field value
func (o *ModelCompliance) GetNodeType() string {
if o == nil {
var ret string
return ret
}
return o.NodeType
}
// GetNodeTypeOk returns a tuple with the NodeType field value
// and a boolean to check if the value has been set.
func (o *ModelCompliance) GetNodeTypeOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.NodeType, true
}
// SetNodeType sets field value
func (o *ModelCompliance) SetNodeType(v string) {
o.NodeType = v
}
// GetRemediationAnsible returns the RemediationAnsible field value
func (o *ModelCompliance) GetRemediationAnsible() string {
if o == nil {
var ret string
return ret
}
return o.RemediationAnsible
}
// GetRemediationAnsibleOk returns a tuple with the RemediationAnsible field value
// and a boolean to check if the value has been set.
func (o *ModelCompliance) GetRemediationAnsibleOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.RemediationAnsible, true
}
// SetRemediationAnsible sets field value
func (o *ModelCompliance) SetRemediationAnsible(v string) {
o.RemediationAnsible = v
}
// GetRemediationPuppet returns the RemediationPuppet field value
func (o *ModelCompliance) GetRemediationPuppet() string {
if o == nil {
var ret string
return ret
}
return o.RemediationPuppet
}
// GetRemediationPuppetOk returns a tuple with the RemediationPuppet field value
// and a boolean to check if the value has been set.
func (o *ModelCompliance) GetRemediationPuppetOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.RemediationPuppet, true
}
// SetRemediationPuppet sets field value
func (o *ModelCompliance) SetRemediationPuppet(v string) {
o.RemediationPuppet = v
}
// GetRemediationScript returns the RemediationScript field value
func (o *ModelCompliance) GetRemediationScript() string {
if o == nil {
var ret string
return ret
}
return o.RemediationScript
}
// GetRemediationScriptOk returns a tuple with the RemediationScript field value
// and a boolean to check if the value has been set.
func (o *ModelCompliance) GetRemediationScriptOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.RemediationScript, true
}
// SetRemediationScript sets field value
func (o *ModelCompliance) SetRemediationScript(v string) {
o.RemediationScript = v
}
// GetResource returns the Resource field value
func (o *ModelCompliance) GetResource() string {
if o == nil {
var ret string
return ret
}
return o.Resource
}
// GetResourceOk returns a tuple with the Resource field value
// and a boolean to check if the value has been set.
func (o *ModelCompliance) GetResourceOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Resource, true
}
// SetResource sets field value
func (o *ModelCompliance) SetResource(v string) {
o.Resource = v
}
// GetResources returns the Resources field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *ModelCompliance) 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 *ModelCompliance) 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 *ModelCompliance) 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 *ModelCompliance) SetResources(v []ModelBasicNode) {
o.Resources = v
}
// GetRuleId returns the RuleId field value
func (o *ModelCompliance) 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 *ModelCompliance) GetRuleIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.RuleId, true
}
// SetRuleId sets field value
func (o *ModelCompliance) SetRuleId(v string) {
o.RuleId = v
}
// GetStatus returns the Status field value
func (o *ModelCompliance) GetStatus() string {
if o == nil {
var ret string
return ret
}
return o.Status
}
// GetStatusOk returns a tuple with the Status field value
// and a boolean to check if the value has been set.
func (o *ModelCompliance) GetStatusOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Status, true
}
// SetStatus sets field value
func (o *ModelCompliance) SetStatus(v string) {
o.Status = v
}
// GetTestCategory returns the TestCategory field value
func (o *ModelCompliance) GetTestCategory() string {
if o == nil {
var ret string
return ret
}
return o.TestCategory
}
// GetTestCategoryOk returns a tuple with the TestCategory field value
// and a boolean to check if the value has been set.
func (o *ModelCompliance) GetTestCategoryOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.TestCategory, true
}
// SetTestCategory sets field value
func (o *ModelCompliance) SetTestCategory(v string) {
o.TestCategory = v
}
// GetTestDesc returns the TestDesc field value
func (o *ModelCompliance) GetTestDesc() string {
if o == nil {
var ret string
return ret
}
return o.TestDesc
}
// GetTestDescOk returns a tuple with the TestDesc field value
// and a boolean to check if the value has been set.
func (o *ModelCompliance) GetTestDescOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.TestDesc, true
}
// SetTestDesc sets field value
func (o *ModelCompliance) SetTestDesc(v string) {
o.TestDesc = v
}
// GetTestNumber returns the TestNumber field value
func (o *ModelCompliance) GetTestNumber() string {
if o == nil {
var ret string
return ret
}
return o.TestNumber
}
// GetTestNumberOk returns a tuple with the TestNumber field value
// and a boolean to check if the value has been set.
func (o *ModelCompliance) GetTestNumberOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.TestNumber, true
}
// SetTestNumber sets field value
func (o *ModelCompliance) SetTestNumber(v string) {
o.TestNumber = v
}
// GetTestRationale returns the TestRationale field value
func (o *ModelCompliance) GetTestRationale() string {
if o == nil {
var ret string
return ret
}
return o.TestRationale
}
// GetTestRationaleOk returns a tuple with the TestRationale field value
// and a boolean to check if the value has been set.
func (o *ModelCompliance) GetTestRationaleOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.TestRationale, true
}
// SetTestRationale sets field value
func (o *ModelCompliance) SetTestRationale(v string) {
o.TestRationale = v
}
// GetTestSeverity returns the TestSeverity field value
func (o *ModelCompliance) GetTestSeverity() string {
if o == nil {
var ret string
return ret
}
return o.TestSeverity
}
// GetTestSeverityOk returns a tuple with the TestSeverity field value
// and a boolean to check if the value has been set.
func (o *ModelCompliance) GetTestSeverityOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.TestSeverity, true
}
// SetTestSeverity sets field value
func (o *ModelCompliance) SetTestSeverity(v string) {
o.TestSeverity = v
}
// GetUpdatedAt returns the UpdatedAt field value
func (o *ModelCompliance) 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 *ModelCompliance) GetUpdatedAtOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.UpdatedAt, true
}
// SetUpdatedAt sets field value
func (o *ModelCompliance) SetUpdatedAt(v int32) {
o.UpdatedAt = v
}
func (o ModelCompliance) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ModelCompliance) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["compliance_check_type"] = o.ComplianceCheckType
toSerialize["description"] = o.Description
toSerialize["masked"] = o.Masked
toSerialize["node_id"] = o.NodeId
toSerialize["node_type"] = o.NodeType
toSerialize["remediation_ansible"] = o.RemediationAnsible
toSerialize["remediation_puppet"] = o.RemediationPuppet
toSerialize["remediation_script"] = o.RemediationScript
toSerialize["resource"] = o.Resource
if o.Resources != nil {
toSerialize["resources"] = o.Resources
}
toSerialize["rule_id"] = o.RuleId
toSerialize["status"] = o.Status
toSerialize["test_category"] = o.TestCategory
toSerialize["test_desc"] = o.TestDesc
toSerialize["test_number"] = o.TestNumber
toSerialize["test_rationale"] = o.TestRationale
toSerialize["test_severity"] = o.TestSeverity
toSerialize["updated_at"] = o.UpdatedAt
return toSerialize, nil
}
func (o *ModelCompliance) UnmarshalJSON(bytes []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{
"compliance_check_type",
"description",
"masked",
"node_id",
"node_type",
"remediation_ansible",
"remediation_puppet",
"remediation_script",
"resource",
"rule_id",
"status",
"test_category",
"test_desc",
"test_number",
"test_rationale",
"test_severity",
"updated_at",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(bytes, &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)
}
}
varModelCompliance := _ModelCompliance{}
err = json.Unmarshal(bytes, &varModelCompliance)
if err != nil {
return err
}
*o = ModelCompliance(varModelCompliance)
return err
}
type NullableModelCompliance struct {
value *ModelCompliance
isSet bool
}
func (v NullableModelCompliance) Get() *ModelCompliance {
return v.value
}
func (v *NullableModelCompliance) Set(val *ModelCompliance) {
v.value = val
v.isSet = true
}
func (v NullableModelCompliance) IsSet() bool {
return v.isSet
}
func (v *NullableModelCompliance) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableModelCompliance(val *ModelCompliance) *NullableModelCompliance {
return &NullableModelCompliance{value: val, isSet: true}
}
func (v NullableModelCompliance) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableModelCompliance) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}