-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmodel_geo_ip_policy.go
633 lines (540 loc) · 17.1 KB
/
model_geo_ip_policy.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
/*
authentik
Making authentication simple.
API version: 2025.2.4
Contact: hello@goauthentik.io
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package api
import (
"encoding/json"
)
// GeoIPPolicy GeoIP Policy Serializer
type GeoIPPolicy struct {
Pk string `json:"pk"`
Name string `json:"name"`
// When this option is enabled, all executions of this policy will be logged. By default, only execution errors are logged.
ExecutionLogging *bool `json:"execution_logging,omitempty"`
// Get object component so that we know how to edit the object
Component string `json:"component"`
// Return object's verbose_name
VerboseName string `json:"verbose_name"`
// Return object's plural verbose_name
VerboseNamePlural string `json:"verbose_name_plural"`
// Return internal model name
MetaModelName string `json:"meta_model_name"`
// Return objects policy is bound to
BoundTo int32 `json:"bound_to"`
Asns []int32 `json:"asns,omitempty"`
Countries []CountryCodeEnum `json:"countries"`
CountriesObj []DetailedCountryField `json:"countries_obj"`
CheckHistoryDistance *bool `json:"check_history_distance,omitempty"`
HistoryMaxDistanceKm *int64 `json:"history_max_distance_km,omitempty"`
DistanceToleranceKm *int32 `json:"distance_tolerance_km,omitempty"`
HistoryLoginCount *int32 `json:"history_login_count,omitempty"`
CheckImpossibleTravel *bool `json:"check_impossible_travel,omitempty"`
ImpossibleToleranceKm *int32 `json:"impossible_tolerance_km,omitempty"`
}
// NewGeoIPPolicy instantiates a new GeoIPPolicy 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 NewGeoIPPolicy(pk string, name string, component string, verboseName string, verboseNamePlural string, metaModelName string, boundTo int32, countries []CountryCodeEnum, countriesObj []DetailedCountryField) *GeoIPPolicy {
this := GeoIPPolicy{}
this.Pk = pk
this.Name = name
this.Component = component
this.VerboseName = verboseName
this.VerboseNamePlural = verboseNamePlural
this.MetaModelName = metaModelName
this.BoundTo = boundTo
this.Countries = countries
this.CountriesObj = countriesObj
return &this
}
// NewGeoIPPolicyWithDefaults instantiates a new GeoIPPolicy 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 NewGeoIPPolicyWithDefaults() *GeoIPPolicy {
this := GeoIPPolicy{}
return &this
}
// GetPk returns the Pk field value
func (o *GeoIPPolicy) GetPk() string {
if o == nil {
var ret string
return ret
}
return o.Pk
}
// GetPkOk returns a tuple with the Pk field value
// and a boolean to check if the value has been set.
func (o *GeoIPPolicy) GetPkOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Pk, true
}
// SetPk sets field value
func (o *GeoIPPolicy) SetPk(v string) {
o.Pk = v
}
// GetName returns the Name field value
func (o *GeoIPPolicy) GetName() string {
if o == nil {
var ret string
return ret
}
return o.Name
}
// GetNameOk returns a tuple with the Name field value
// and a boolean to check if the value has been set.
func (o *GeoIPPolicy) GetNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Name, true
}
// SetName sets field value
func (o *GeoIPPolicy) SetName(v string) {
o.Name = v
}
// GetExecutionLogging returns the ExecutionLogging field value if set, zero value otherwise.
func (o *GeoIPPolicy) GetExecutionLogging() bool {
if o == nil || o.ExecutionLogging == nil {
var ret bool
return ret
}
return *o.ExecutionLogging
}
// GetExecutionLoggingOk returns a tuple with the ExecutionLogging field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GeoIPPolicy) GetExecutionLoggingOk() (*bool, bool) {
if o == nil || o.ExecutionLogging == nil {
return nil, false
}
return o.ExecutionLogging, true
}
// HasExecutionLogging returns a boolean if a field has been set.
func (o *GeoIPPolicy) HasExecutionLogging() bool {
if o != nil && o.ExecutionLogging != nil {
return true
}
return false
}
// SetExecutionLogging gets a reference to the given bool and assigns it to the ExecutionLogging field.
func (o *GeoIPPolicy) SetExecutionLogging(v bool) {
o.ExecutionLogging = &v
}
// GetComponent returns the Component field value
func (o *GeoIPPolicy) GetComponent() string {
if o == nil {
var ret string
return ret
}
return o.Component
}
// GetComponentOk returns a tuple with the Component field value
// and a boolean to check if the value has been set.
func (o *GeoIPPolicy) GetComponentOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Component, true
}
// SetComponent sets field value
func (o *GeoIPPolicy) SetComponent(v string) {
o.Component = v
}
// GetVerboseName returns the VerboseName field value
func (o *GeoIPPolicy) GetVerboseName() string {
if o == nil {
var ret string
return ret
}
return o.VerboseName
}
// GetVerboseNameOk returns a tuple with the VerboseName field value
// and a boolean to check if the value has been set.
func (o *GeoIPPolicy) GetVerboseNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.VerboseName, true
}
// SetVerboseName sets field value
func (o *GeoIPPolicy) SetVerboseName(v string) {
o.VerboseName = v
}
// GetVerboseNamePlural returns the VerboseNamePlural field value
func (o *GeoIPPolicy) GetVerboseNamePlural() string {
if o == nil {
var ret string
return ret
}
return o.VerboseNamePlural
}
// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value
// and a boolean to check if the value has been set.
func (o *GeoIPPolicy) GetVerboseNamePluralOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.VerboseNamePlural, true
}
// SetVerboseNamePlural sets field value
func (o *GeoIPPolicy) SetVerboseNamePlural(v string) {
o.VerboseNamePlural = v
}
// GetMetaModelName returns the MetaModelName field value
func (o *GeoIPPolicy) GetMetaModelName() string {
if o == nil {
var ret string
return ret
}
return o.MetaModelName
}
// GetMetaModelNameOk returns a tuple with the MetaModelName field value
// and a boolean to check if the value has been set.
func (o *GeoIPPolicy) GetMetaModelNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.MetaModelName, true
}
// SetMetaModelName sets field value
func (o *GeoIPPolicy) SetMetaModelName(v string) {
o.MetaModelName = v
}
// GetBoundTo returns the BoundTo field value
func (o *GeoIPPolicy) GetBoundTo() int32 {
if o == nil {
var ret int32
return ret
}
return o.BoundTo
}
// GetBoundToOk returns a tuple with the BoundTo field value
// and a boolean to check if the value has been set.
func (o *GeoIPPolicy) GetBoundToOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.BoundTo, true
}
// SetBoundTo sets field value
func (o *GeoIPPolicy) SetBoundTo(v int32) {
o.BoundTo = v
}
// GetAsns returns the Asns field value if set, zero value otherwise.
func (o *GeoIPPolicy) GetAsns() []int32 {
if o == nil || o.Asns == nil {
var ret []int32
return ret
}
return o.Asns
}
// GetAsnsOk returns a tuple with the Asns field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GeoIPPolicy) GetAsnsOk() ([]int32, bool) {
if o == nil || o.Asns == nil {
return nil, false
}
return o.Asns, true
}
// HasAsns returns a boolean if a field has been set.
func (o *GeoIPPolicy) HasAsns() bool {
if o != nil && o.Asns != nil {
return true
}
return false
}
// SetAsns gets a reference to the given []int32 and assigns it to the Asns field.
func (o *GeoIPPolicy) SetAsns(v []int32) {
o.Asns = v
}
// GetCountries returns the Countries field value
func (o *GeoIPPolicy) GetCountries() []CountryCodeEnum {
if o == nil {
var ret []CountryCodeEnum
return ret
}
return o.Countries
}
// GetCountriesOk returns a tuple with the Countries field value
// and a boolean to check if the value has been set.
func (o *GeoIPPolicy) GetCountriesOk() ([]CountryCodeEnum, bool) {
if o == nil {
return nil, false
}
return o.Countries, true
}
// SetCountries sets field value
func (o *GeoIPPolicy) SetCountries(v []CountryCodeEnum) {
o.Countries = v
}
// GetCountriesObj returns the CountriesObj field value
func (o *GeoIPPolicy) GetCountriesObj() []DetailedCountryField {
if o == nil {
var ret []DetailedCountryField
return ret
}
return o.CountriesObj
}
// GetCountriesObjOk returns a tuple with the CountriesObj field value
// and a boolean to check if the value has been set.
func (o *GeoIPPolicy) GetCountriesObjOk() ([]DetailedCountryField, bool) {
if o == nil {
return nil, false
}
return o.CountriesObj, true
}
// SetCountriesObj sets field value
func (o *GeoIPPolicy) SetCountriesObj(v []DetailedCountryField) {
o.CountriesObj = v
}
// GetCheckHistoryDistance returns the CheckHistoryDistance field value if set, zero value otherwise.
func (o *GeoIPPolicy) GetCheckHistoryDistance() bool {
if o == nil || o.CheckHistoryDistance == nil {
var ret bool
return ret
}
return *o.CheckHistoryDistance
}
// GetCheckHistoryDistanceOk returns a tuple with the CheckHistoryDistance field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GeoIPPolicy) GetCheckHistoryDistanceOk() (*bool, bool) {
if o == nil || o.CheckHistoryDistance == nil {
return nil, false
}
return o.CheckHistoryDistance, true
}
// HasCheckHistoryDistance returns a boolean if a field has been set.
func (o *GeoIPPolicy) HasCheckHistoryDistance() bool {
if o != nil && o.CheckHistoryDistance != nil {
return true
}
return false
}
// SetCheckHistoryDistance gets a reference to the given bool and assigns it to the CheckHistoryDistance field.
func (o *GeoIPPolicy) SetCheckHistoryDistance(v bool) {
o.CheckHistoryDistance = &v
}
// GetHistoryMaxDistanceKm returns the HistoryMaxDistanceKm field value if set, zero value otherwise.
func (o *GeoIPPolicy) GetHistoryMaxDistanceKm() int64 {
if o == nil || o.HistoryMaxDistanceKm == nil {
var ret int64
return ret
}
return *o.HistoryMaxDistanceKm
}
// GetHistoryMaxDistanceKmOk returns a tuple with the HistoryMaxDistanceKm field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GeoIPPolicy) GetHistoryMaxDistanceKmOk() (*int64, bool) {
if o == nil || o.HistoryMaxDistanceKm == nil {
return nil, false
}
return o.HistoryMaxDistanceKm, true
}
// HasHistoryMaxDistanceKm returns a boolean if a field has been set.
func (o *GeoIPPolicy) HasHistoryMaxDistanceKm() bool {
if o != nil && o.HistoryMaxDistanceKm != nil {
return true
}
return false
}
// SetHistoryMaxDistanceKm gets a reference to the given int64 and assigns it to the HistoryMaxDistanceKm field.
func (o *GeoIPPolicy) SetHistoryMaxDistanceKm(v int64) {
o.HistoryMaxDistanceKm = &v
}
// GetDistanceToleranceKm returns the DistanceToleranceKm field value if set, zero value otherwise.
func (o *GeoIPPolicy) GetDistanceToleranceKm() int32 {
if o == nil || o.DistanceToleranceKm == nil {
var ret int32
return ret
}
return *o.DistanceToleranceKm
}
// GetDistanceToleranceKmOk returns a tuple with the DistanceToleranceKm field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GeoIPPolicy) GetDistanceToleranceKmOk() (*int32, bool) {
if o == nil || o.DistanceToleranceKm == nil {
return nil, false
}
return o.DistanceToleranceKm, true
}
// HasDistanceToleranceKm returns a boolean if a field has been set.
func (o *GeoIPPolicy) HasDistanceToleranceKm() bool {
if o != nil && o.DistanceToleranceKm != nil {
return true
}
return false
}
// SetDistanceToleranceKm gets a reference to the given int32 and assigns it to the DistanceToleranceKm field.
func (o *GeoIPPolicy) SetDistanceToleranceKm(v int32) {
o.DistanceToleranceKm = &v
}
// GetHistoryLoginCount returns the HistoryLoginCount field value if set, zero value otherwise.
func (o *GeoIPPolicy) GetHistoryLoginCount() int32 {
if o == nil || o.HistoryLoginCount == nil {
var ret int32
return ret
}
return *o.HistoryLoginCount
}
// GetHistoryLoginCountOk returns a tuple with the HistoryLoginCount field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GeoIPPolicy) GetHistoryLoginCountOk() (*int32, bool) {
if o == nil || o.HistoryLoginCount == nil {
return nil, false
}
return o.HistoryLoginCount, true
}
// HasHistoryLoginCount returns a boolean if a field has been set.
func (o *GeoIPPolicy) HasHistoryLoginCount() bool {
if o != nil && o.HistoryLoginCount != nil {
return true
}
return false
}
// SetHistoryLoginCount gets a reference to the given int32 and assigns it to the HistoryLoginCount field.
func (o *GeoIPPolicy) SetHistoryLoginCount(v int32) {
o.HistoryLoginCount = &v
}
// GetCheckImpossibleTravel returns the CheckImpossibleTravel field value if set, zero value otherwise.
func (o *GeoIPPolicy) GetCheckImpossibleTravel() bool {
if o == nil || o.CheckImpossibleTravel == nil {
var ret bool
return ret
}
return *o.CheckImpossibleTravel
}
// GetCheckImpossibleTravelOk returns a tuple with the CheckImpossibleTravel field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GeoIPPolicy) GetCheckImpossibleTravelOk() (*bool, bool) {
if o == nil || o.CheckImpossibleTravel == nil {
return nil, false
}
return o.CheckImpossibleTravel, true
}
// HasCheckImpossibleTravel returns a boolean if a field has been set.
func (o *GeoIPPolicy) HasCheckImpossibleTravel() bool {
if o != nil && o.CheckImpossibleTravel != nil {
return true
}
return false
}
// SetCheckImpossibleTravel gets a reference to the given bool and assigns it to the CheckImpossibleTravel field.
func (o *GeoIPPolicy) SetCheckImpossibleTravel(v bool) {
o.CheckImpossibleTravel = &v
}
// GetImpossibleToleranceKm returns the ImpossibleToleranceKm field value if set, zero value otherwise.
func (o *GeoIPPolicy) GetImpossibleToleranceKm() int32 {
if o == nil || o.ImpossibleToleranceKm == nil {
var ret int32
return ret
}
return *o.ImpossibleToleranceKm
}
// GetImpossibleToleranceKmOk returns a tuple with the ImpossibleToleranceKm field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GeoIPPolicy) GetImpossibleToleranceKmOk() (*int32, bool) {
if o == nil || o.ImpossibleToleranceKm == nil {
return nil, false
}
return o.ImpossibleToleranceKm, true
}
// HasImpossibleToleranceKm returns a boolean if a field has been set.
func (o *GeoIPPolicy) HasImpossibleToleranceKm() bool {
if o != nil && o.ImpossibleToleranceKm != nil {
return true
}
return false
}
// SetImpossibleToleranceKm gets a reference to the given int32 and assigns it to the ImpossibleToleranceKm field.
func (o *GeoIPPolicy) SetImpossibleToleranceKm(v int32) {
o.ImpossibleToleranceKm = &v
}
func (o GeoIPPolicy) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["pk"] = o.Pk
}
if true {
toSerialize["name"] = o.Name
}
if o.ExecutionLogging != nil {
toSerialize["execution_logging"] = o.ExecutionLogging
}
if true {
toSerialize["component"] = o.Component
}
if true {
toSerialize["verbose_name"] = o.VerboseName
}
if true {
toSerialize["verbose_name_plural"] = o.VerboseNamePlural
}
if true {
toSerialize["meta_model_name"] = o.MetaModelName
}
if true {
toSerialize["bound_to"] = o.BoundTo
}
if o.Asns != nil {
toSerialize["asns"] = o.Asns
}
if true {
toSerialize["countries"] = o.Countries
}
if true {
toSerialize["countries_obj"] = o.CountriesObj
}
if o.CheckHistoryDistance != nil {
toSerialize["check_history_distance"] = o.CheckHistoryDistance
}
if o.HistoryMaxDistanceKm != nil {
toSerialize["history_max_distance_km"] = o.HistoryMaxDistanceKm
}
if o.DistanceToleranceKm != nil {
toSerialize["distance_tolerance_km"] = o.DistanceToleranceKm
}
if o.HistoryLoginCount != nil {
toSerialize["history_login_count"] = o.HistoryLoginCount
}
if o.CheckImpossibleTravel != nil {
toSerialize["check_impossible_travel"] = o.CheckImpossibleTravel
}
if o.ImpossibleToleranceKm != nil {
toSerialize["impossible_tolerance_km"] = o.ImpossibleToleranceKm
}
return json.Marshal(toSerialize)
}
type NullableGeoIPPolicy struct {
value *GeoIPPolicy
isSet bool
}
func (v NullableGeoIPPolicy) Get() *GeoIPPolicy {
return v.value
}
func (v *NullableGeoIPPolicy) Set(val *GeoIPPolicy) {
v.value = val
v.isSet = true
}
func (v NullableGeoIPPolicy) IsSet() bool {
return v.isSet
}
func (v *NullableGeoIPPolicy) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableGeoIPPolicy(val *GeoIPPolicy) *NullableGeoIPPolicy {
return &NullableGeoIPPolicy{value: val, isSet: true}
}
func (v NullableGeoIPPolicy) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableGeoIPPolicy) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}