/
model_graph_topology_filters.go
379 lines (315 loc) · 11 KB
/
model_graph_topology_filters.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
/*
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 GraphTopologyFilters type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &GraphTopologyFilters{}
// GraphTopologyFilters struct for GraphTopologyFilters
type GraphTopologyFilters struct {
CloudFilter []string `json:"cloud_filter"`
ContainerFilter []string `json:"container_filter"`
FieldFilters ReportersFieldsFilters `json:"field_filters"`
HostFilter []string `json:"host_filter"`
KubernetesFilter []string `json:"kubernetes_filter"`
PodFilter []string `json:"pod_filter"`
RegionFilter []string `json:"region_filter"`
SkipConnections bool `json:"skip_connections"`
}
type _GraphTopologyFilters GraphTopologyFilters
// NewGraphTopologyFilters instantiates a new GraphTopologyFilters 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 NewGraphTopologyFilters(cloudFilter []string, containerFilter []string, fieldFilters ReportersFieldsFilters, hostFilter []string, kubernetesFilter []string, podFilter []string, regionFilter []string, skipConnections bool) *GraphTopologyFilters {
this := GraphTopologyFilters{}
this.CloudFilter = cloudFilter
this.ContainerFilter = containerFilter
this.FieldFilters = fieldFilters
this.HostFilter = hostFilter
this.KubernetesFilter = kubernetesFilter
this.PodFilter = podFilter
this.RegionFilter = regionFilter
this.SkipConnections = skipConnections
return &this
}
// NewGraphTopologyFiltersWithDefaults instantiates a new GraphTopologyFilters 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 NewGraphTopologyFiltersWithDefaults() *GraphTopologyFilters {
this := GraphTopologyFilters{}
return &this
}
// GetCloudFilter returns the CloudFilter field value
// If the value is explicit nil, the zero value for []string will be returned
func (o *GraphTopologyFilters) GetCloudFilter() []string {
if o == nil {
var ret []string
return ret
}
return o.CloudFilter
}
// GetCloudFilterOk returns a tuple with the CloudFilter 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 *GraphTopologyFilters) GetCloudFilterOk() ([]string, bool) {
if o == nil || IsNil(o.CloudFilter) {
return nil, false
}
return o.CloudFilter, true
}
// SetCloudFilter sets field value
func (o *GraphTopologyFilters) SetCloudFilter(v []string) {
o.CloudFilter = v
}
// GetContainerFilter returns the ContainerFilter field value
// If the value is explicit nil, the zero value for []string will be returned
func (o *GraphTopologyFilters) GetContainerFilter() []string {
if o == nil {
var ret []string
return ret
}
return o.ContainerFilter
}
// GetContainerFilterOk returns a tuple with the ContainerFilter 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 *GraphTopologyFilters) GetContainerFilterOk() ([]string, bool) {
if o == nil || IsNil(o.ContainerFilter) {
return nil, false
}
return o.ContainerFilter, true
}
// SetContainerFilter sets field value
func (o *GraphTopologyFilters) SetContainerFilter(v []string) {
o.ContainerFilter = v
}
// GetFieldFilters returns the FieldFilters field value
func (o *GraphTopologyFilters) GetFieldFilters() ReportersFieldsFilters {
if o == nil {
var ret ReportersFieldsFilters
return ret
}
return o.FieldFilters
}
// GetFieldFiltersOk returns a tuple with the FieldFilters field value
// and a boolean to check if the value has been set.
func (o *GraphTopologyFilters) GetFieldFiltersOk() (*ReportersFieldsFilters, bool) {
if o == nil {
return nil, false
}
return &o.FieldFilters, true
}
// SetFieldFilters sets field value
func (o *GraphTopologyFilters) SetFieldFilters(v ReportersFieldsFilters) {
o.FieldFilters = v
}
// GetHostFilter returns the HostFilter field value
// If the value is explicit nil, the zero value for []string will be returned
func (o *GraphTopologyFilters) GetHostFilter() []string {
if o == nil {
var ret []string
return ret
}
return o.HostFilter
}
// GetHostFilterOk returns a tuple with the HostFilter 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 *GraphTopologyFilters) GetHostFilterOk() ([]string, bool) {
if o == nil || IsNil(o.HostFilter) {
return nil, false
}
return o.HostFilter, true
}
// SetHostFilter sets field value
func (o *GraphTopologyFilters) SetHostFilter(v []string) {
o.HostFilter = v
}
// GetKubernetesFilter returns the KubernetesFilter field value
// If the value is explicit nil, the zero value for []string will be returned
func (o *GraphTopologyFilters) GetKubernetesFilter() []string {
if o == nil {
var ret []string
return ret
}
return o.KubernetesFilter
}
// GetKubernetesFilterOk returns a tuple with the KubernetesFilter 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 *GraphTopologyFilters) GetKubernetesFilterOk() ([]string, bool) {
if o == nil || IsNil(o.KubernetesFilter) {
return nil, false
}
return o.KubernetesFilter, true
}
// SetKubernetesFilter sets field value
func (o *GraphTopologyFilters) SetKubernetesFilter(v []string) {
o.KubernetesFilter = v
}
// GetPodFilter returns the PodFilter field value
// If the value is explicit nil, the zero value for []string will be returned
func (o *GraphTopologyFilters) GetPodFilter() []string {
if o == nil {
var ret []string
return ret
}
return o.PodFilter
}
// GetPodFilterOk returns a tuple with the PodFilter 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 *GraphTopologyFilters) GetPodFilterOk() ([]string, bool) {
if o == nil || IsNil(o.PodFilter) {
return nil, false
}
return o.PodFilter, true
}
// SetPodFilter sets field value
func (o *GraphTopologyFilters) SetPodFilter(v []string) {
o.PodFilter = v
}
// GetRegionFilter returns the RegionFilter field value
// If the value is explicit nil, the zero value for []string will be returned
func (o *GraphTopologyFilters) GetRegionFilter() []string {
if o == nil {
var ret []string
return ret
}
return o.RegionFilter
}
// GetRegionFilterOk returns a tuple with the RegionFilter 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 *GraphTopologyFilters) GetRegionFilterOk() ([]string, bool) {
if o == nil || IsNil(o.RegionFilter) {
return nil, false
}
return o.RegionFilter, true
}
// SetRegionFilter sets field value
func (o *GraphTopologyFilters) SetRegionFilter(v []string) {
o.RegionFilter = v
}
// GetSkipConnections returns the SkipConnections field value
func (o *GraphTopologyFilters) GetSkipConnections() bool {
if o == nil {
var ret bool
return ret
}
return o.SkipConnections
}
// GetSkipConnectionsOk returns a tuple with the SkipConnections field value
// and a boolean to check if the value has been set.
func (o *GraphTopologyFilters) GetSkipConnectionsOk() (*bool, bool) {
if o == nil {
return nil, false
}
return &o.SkipConnections, true
}
// SetSkipConnections sets field value
func (o *GraphTopologyFilters) SetSkipConnections(v bool) {
o.SkipConnections = v
}
func (o GraphTopologyFilters) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o GraphTopologyFilters) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if o.CloudFilter != nil {
toSerialize["cloud_filter"] = o.CloudFilter
}
if o.ContainerFilter != nil {
toSerialize["container_filter"] = o.ContainerFilter
}
toSerialize["field_filters"] = o.FieldFilters
if o.HostFilter != nil {
toSerialize["host_filter"] = o.HostFilter
}
if o.KubernetesFilter != nil {
toSerialize["kubernetes_filter"] = o.KubernetesFilter
}
if o.PodFilter != nil {
toSerialize["pod_filter"] = o.PodFilter
}
if o.RegionFilter != nil {
toSerialize["region_filter"] = o.RegionFilter
}
toSerialize["skip_connections"] = o.SkipConnections
return toSerialize, nil
}
func (o *GraphTopologyFilters) 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{
"cloud_filter",
"container_filter",
"field_filters",
"host_filter",
"kubernetes_filter",
"pod_filter",
"region_filter",
"skip_connections",
}
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)
}
}
varGraphTopologyFilters := _GraphTopologyFilters{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varGraphTopologyFilters)
if err != nil {
return err
}
*o = GraphTopologyFilters(varGraphTopologyFilters)
return err
}
type NullableGraphTopologyFilters struct {
value *GraphTopologyFilters
isSet bool
}
func (v NullableGraphTopologyFilters) Get() *GraphTopologyFilters {
return v.value
}
func (v *NullableGraphTopologyFilters) Set(val *GraphTopologyFilters) {
v.value = val
v.isSet = true
}
func (v NullableGraphTopologyFilters) IsSet() bool {
return v.isSet
}
func (v *NullableGraphTopologyFilters) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableGraphTopologyFilters(val *GraphTopologyFilters) *NullableGraphTopologyFilters {
return &NullableGraphTopologyFilters{value: val, isSet: true}
}
func (v NullableGraphTopologyFilters) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableGraphTopologyFilters) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}