-
Notifications
You must be signed in to change notification settings - Fork 3
/
model_attack_report_item.go
451 lines (380 loc) · 11.6 KB
/
model_attack_report_item.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
/*
ArvanCloud CDN Services
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
API version: 4.99.2
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package r1cdn
import (
"encoding/json"
"time"
)
// checks if the AttackReportItem type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &AttackReportItem{}
// AttackReportItem struct for AttackReportItem
type AttackReportItem struct {
AttackerIp *string `json:"attacker_ip,omitempty"`
AttackerCountry *string `json:"attacker_country,omitempty"`
Method *string `json:"method,omitempty"`
Uri *string `json:"uri,omitempty"`
Host []string `json:"host,omitempty"`
Timestamp *time.Time `json:"timestamp,omitempty"`
UriArgs *string `json:"uri_args,omitempty"`
Cookie []string `json:"cookie,omitempty"`
Alerts []string `json:"alerts,omitempty"`
UserAgent []string `json:"user_agent,omitempty"`
}
// NewAttackReportItem instantiates a new AttackReportItem 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 NewAttackReportItem() *AttackReportItem {
this := AttackReportItem{}
return &this
}
// NewAttackReportItemWithDefaults instantiates a new AttackReportItem 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 NewAttackReportItemWithDefaults() *AttackReportItem {
this := AttackReportItem{}
return &this
}
// GetAttackerIp returns the AttackerIp field value if set, zero value otherwise.
func (o *AttackReportItem) GetAttackerIp() string {
if o == nil || IsNil(o.AttackerIp) {
var ret string
return ret
}
return *o.AttackerIp
}
// GetAttackerIpOk returns a tuple with the AttackerIp field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AttackReportItem) GetAttackerIpOk() (*string, bool) {
if o == nil || IsNil(o.AttackerIp) {
return nil, false
}
return o.AttackerIp, true
}
// HasAttackerIp returns a boolean if a field has been set.
func (o *AttackReportItem) HasAttackerIp() bool {
if o != nil && !IsNil(o.AttackerIp) {
return true
}
return false
}
// SetAttackerIp gets a reference to the given string and assigns it to the AttackerIp field.
func (o *AttackReportItem) SetAttackerIp(v string) {
o.AttackerIp = &v
}
// GetAttackerCountry returns the AttackerCountry field value if set, zero value otherwise.
func (o *AttackReportItem) GetAttackerCountry() string {
if o == nil || IsNil(o.AttackerCountry) {
var ret string
return ret
}
return *o.AttackerCountry
}
// GetAttackerCountryOk returns a tuple with the AttackerCountry field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AttackReportItem) GetAttackerCountryOk() (*string, bool) {
if o == nil || IsNil(o.AttackerCountry) {
return nil, false
}
return o.AttackerCountry, true
}
// HasAttackerCountry returns a boolean if a field has been set.
func (o *AttackReportItem) HasAttackerCountry() bool {
if o != nil && !IsNil(o.AttackerCountry) {
return true
}
return false
}
// SetAttackerCountry gets a reference to the given string and assigns it to the AttackerCountry field.
func (o *AttackReportItem) SetAttackerCountry(v string) {
o.AttackerCountry = &v
}
// GetMethod returns the Method field value if set, zero value otherwise.
func (o *AttackReportItem) GetMethod() string {
if o == nil || IsNil(o.Method) {
var ret string
return ret
}
return *o.Method
}
// GetMethodOk returns a tuple with the Method field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AttackReportItem) GetMethodOk() (*string, bool) {
if o == nil || IsNil(o.Method) {
return nil, false
}
return o.Method, true
}
// HasMethod returns a boolean if a field has been set.
func (o *AttackReportItem) HasMethod() bool {
if o != nil && !IsNil(o.Method) {
return true
}
return false
}
// SetMethod gets a reference to the given string and assigns it to the Method field.
func (o *AttackReportItem) SetMethod(v string) {
o.Method = &v
}
// GetUri returns the Uri field value if set, zero value otherwise.
func (o *AttackReportItem) GetUri() string {
if o == nil || IsNil(o.Uri) {
var ret string
return ret
}
return *o.Uri
}
// GetUriOk returns a tuple with the Uri field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AttackReportItem) GetUriOk() (*string, bool) {
if o == nil || IsNil(o.Uri) {
return nil, false
}
return o.Uri, true
}
// HasUri returns a boolean if a field has been set.
func (o *AttackReportItem) HasUri() bool {
if o != nil && !IsNil(o.Uri) {
return true
}
return false
}
// SetUri gets a reference to the given string and assigns it to the Uri field.
func (o *AttackReportItem) SetUri(v string) {
o.Uri = &v
}
// GetHost returns the Host field value if set, zero value otherwise.
func (o *AttackReportItem) GetHost() []string {
if o == nil || IsNil(o.Host) {
var ret []string
return ret
}
return o.Host
}
// GetHostOk returns a tuple with the Host field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AttackReportItem) GetHostOk() ([]string, bool) {
if o == nil || IsNil(o.Host) {
return nil, false
}
return o.Host, true
}
// HasHost returns a boolean if a field has been set.
func (o *AttackReportItem) HasHost() bool {
if o != nil && !IsNil(o.Host) {
return true
}
return false
}
// SetHost gets a reference to the given []string and assigns it to the Host field.
func (o *AttackReportItem) SetHost(v []string) {
o.Host = v
}
// GetTimestamp returns the Timestamp field value if set, zero value otherwise.
func (o *AttackReportItem) GetTimestamp() time.Time {
if o == nil || IsNil(o.Timestamp) {
var ret time.Time
return ret
}
return *o.Timestamp
}
// GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AttackReportItem) GetTimestampOk() (*time.Time, bool) {
if o == nil || IsNil(o.Timestamp) {
return nil, false
}
return o.Timestamp, true
}
// HasTimestamp returns a boolean if a field has been set.
func (o *AttackReportItem) HasTimestamp() bool {
if o != nil && !IsNil(o.Timestamp) {
return true
}
return false
}
// SetTimestamp gets a reference to the given time.Time and assigns it to the Timestamp field.
func (o *AttackReportItem) SetTimestamp(v time.Time) {
o.Timestamp = &v
}
// GetUriArgs returns the UriArgs field value if set, zero value otherwise.
func (o *AttackReportItem) GetUriArgs() string {
if o == nil || IsNil(o.UriArgs) {
var ret string
return ret
}
return *o.UriArgs
}
// GetUriArgsOk returns a tuple with the UriArgs field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AttackReportItem) GetUriArgsOk() (*string, bool) {
if o == nil || IsNil(o.UriArgs) {
return nil, false
}
return o.UriArgs, true
}
// HasUriArgs returns a boolean if a field has been set.
func (o *AttackReportItem) HasUriArgs() bool {
if o != nil && !IsNil(o.UriArgs) {
return true
}
return false
}
// SetUriArgs gets a reference to the given string and assigns it to the UriArgs field.
func (o *AttackReportItem) SetUriArgs(v string) {
o.UriArgs = &v
}
// GetCookie returns the Cookie field value if set, zero value otherwise.
func (o *AttackReportItem) GetCookie() []string {
if o == nil || IsNil(o.Cookie) {
var ret []string
return ret
}
return o.Cookie
}
// GetCookieOk returns a tuple with the Cookie field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AttackReportItem) GetCookieOk() ([]string, bool) {
if o == nil || IsNil(o.Cookie) {
return nil, false
}
return o.Cookie, true
}
// HasCookie returns a boolean if a field has been set.
func (o *AttackReportItem) HasCookie() bool {
if o != nil && !IsNil(o.Cookie) {
return true
}
return false
}
// SetCookie gets a reference to the given []string and assigns it to the Cookie field.
func (o *AttackReportItem) SetCookie(v []string) {
o.Cookie = v
}
// GetAlerts returns the Alerts field value if set, zero value otherwise.
func (o *AttackReportItem) GetAlerts() []string {
if o == nil || IsNil(o.Alerts) {
var ret []string
return ret
}
return o.Alerts
}
// GetAlertsOk returns a tuple with the Alerts field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AttackReportItem) GetAlertsOk() ([]string, bool) {
if o == nil || IsNil(o.Alerts) {
return nil, false
}
return o.Alerts, true
}
// HasAlerts returns a boolean if a field has been set.
func (o *AttackReportItem) HasAlerts() bool {
if o != nil && !IsNil(o.Alerts) {
return true
}
return false
}
// SetAlerts gets a reference to the given []string and assigns it to the Alerts field.
func (o *AttackReportItem) SetAlerts(v []string) {
o.Alerts = v
}
// GetUserAgent returns the UserAgent field value if set, zero value otherwise.
func (o *AttackReportItem) GetUserAgent() []string {
if o == nil || IsNil(o.UserAgent) {
var ret []string
return ret
}
return o.UserAgent
}
// GetUserAgentOk returns a tuple with the UserAgent field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AttackReportItem) GetUserAgentOk() ([]string, bool) {
if o == nil || IsNil(o.UserAgent) {
return nil, false
}
return o.UserAgent, true
}
// HasUserAgent returns a boolean if a field has been set.
func (o *AttackReportItem) HasUserAgent() bool {
if o != nil && !IsNil(o.UserAgent) {
return true
}
return false
}
// SetUserAgent gets a reference to the given []string and assigns it to the UserAgent field.
func (o *AttackReportItem) SetUserAgent(v []string) {
o.UserAgent = v
}
func (o AttackReportItem) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o AttackReportItem) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.AttackerIp) {
toSerialize["attacker_ip"] = o.AttackerIp
}
if !IsNil(o.AttackerCountry) {
toSerialize["attacker_country"] = o.AttackerCountry
}
if !IsNil(o.Method) {
toSerialize["method"] = o.Method
}
if !IsNil(o.Uri) {
toSerialize["uri"] = o.Uri
}
if !IsNil(o.Host) {
toSerialize["host"] = o.Host
}
if !IsNil(o.Timestamp) {
toSerialize["timestamp"] = o.Timestamp
}
if !IsNil(o.UriArgs) {
toSerialize["uri_args"] = o.UriArgs
}
if !IsNil(o.Cookie) {
toSerialize["cookie"] = o.Cookie
}
if !IsNil(o.Alerts) {
toSerialize["alerts"] = o.Alerts
}
if !IsNil(o.UserAgent) {
toSerialize["user_agent"] = o.UserAgent
}
return toSerialize, nil
}
type NullableAttackReportItem struct {
value *AttackReportItem
isSet bool
}
func (v NullableAttackReportItem) Get() *AttackReportItem {
return v.value
}
func (v *NullableAttackReportItem) Set(val *AttackReportItem) {
v.value = val
v.isSet = true
}
func (v NullableAttackReportItem) IsSet() bool {
return v.isSet
}
func (v *NullableAttackReportItem) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAttackReportItem(val *AttackReportItem) *NullableAttackReportItem {
return &NullableAttackReportItem{value: val, isSet: true}
}
func (v NullableAttackReportItem) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAttackReportItem) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}