-
Notifications
You must be signed in to change notification settings - Fork 52
/
model_ip_ranges.go
561 lines (497 loc) · 18.6 KB
/
model_ip_ranges.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
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2019-Present Datadog, Inc.
package datadogV1
import (
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
)
// IPRanges IP ranges.
type IPRanges struct {
// Available prefix information for the Agent endpoints.
Agents *IPPrefixesAgents `json:"agents,omitempty"`
// Available prefix information for the API endpoints.
Api *IPPrefixesAPI `json:"api,omitempty"`
// Available prefix information for the APM endpoints.
Apm *IPPrefixesAPM `json:"apm,omitempty"`
// Available prefix information for all Datadog endpoints.
Global *IPPrefixesGlobal `json:"global,omitempty"`
// Available prefix information for the Logs endpoints.
Logs *IPPrefixesLogs `json:"logs,omitempty"`
// Date when last updated, in the form `YYYY-MM-DD-hh-mm-ss`.
Modified *string `json:"modified,omitempty"`
// Available prefix information for the Orchestrator endpoints.
Orchestrator *IPPrefixesOrchestrator `json:"orchestrator,omitempty"`
// Available prefix information for the Process endpoints.
Process *IPPrefixesProcess `json:"process,omitempty"`
// Available prefix information for the Remote Configuration endpoints.
RemoteConfiguration *IPPrefixesRemoteConfiguration `json:"remote-configuration,omitempty"`
// Available prefix information for the Synthetics endpoints.
Synthetics *IPPrefixesSynthetics `json:"synthetics,omitempty"`
// Available prefix information for the Synthetics Private Locations endpoints.
SyntheticsPrivateLocations *IPPrefixesSyntheticsPrivateLocations `json:"synthetics-private-locations,omitempty"`
// Version of the IP list.
Version *int64 `json:"version,omitempty"`
// Available prefix information for the Webhook endpoints.
Webhooks *IPPrefixesWebhooks `json:"webhooks,omitempty"`
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
UnparsedObject map[string]interface{} `json:"-"`
AdditionalProperties map[string]interface{}
}
// NewIPRanges instantiates a new IPRanges 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 NewIPRanges() *IPRanges {
this := IPRanges{}
return &this
}
// NewIPRangesWithDefaults instantiates a new IPRanges 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 NewIPRangesWithDefaults() *IPRanges {
this := IPRanges{}
return &this
}
// GetAgents returns the Agents field value if set, zero value otherwise.
func (o *IPRanges) GetAgents() IPPrefixesAgents {
if o == nil || o.Agents == nil {
var ret IPPrefixesAgents
return ret
}
return *o.Agents
}
// GetAgentsOk returns a tuple with the Agents field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IPRanges) GetAgentsOk() (*IPPrefixesAgents, bool) {
if o == nil || o.Agents == nil {
return nil, false
}
return o.Agents, true
}
// HasAgents returns a boolean if a field has been set.
func (o *IPRanges) HasAgents() bool {
return o != nil && o.Agents != nil
}
// SetAgents gets a reference to the given IPPrefixesAgents and assigns it to the Agents field.
func (o *IPRanges) SetAgents(v IPPrefixesAgents) {
o.Agents = &v
}
// GetApi returns the Api field value if set, zero value otherwise.
func (o *IPRanges) GetApi() IPPrefixesAPI {
if o == nil || o.Api == nil {
var ret IPPrefixesAPI
return ret
}
return *o.Api
}
// GetApiOk returns a tuple with the Api field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IPRanges) GetApiOk() (*IPPrefixesAPI, bool) {
if o == nil || o.Api == nil {
return nil, false
}
return o.Api, true
}
// HasApi returns a boolean if a field has been set.
func (o *IPRanges) HasApi() bool {
return o != nil && o.Api != nil
}
// SetApi gets a reference to the given IPPrefixesAPI and assigns it to the Api field.
func (o *IPRanges) SetApi(v IPPrefixesAPI) {
o.Api = &v
}
// GetApm returns the Apm field value if set, zero value otherwise.
func (o *IPRanges) GetApm() IPPrefixesAPM {
if o == nil || o.Apm == nil {
var ret IPPrefixesAPM
return ret
}
return *o.Apm
}
// GetApmOk returns a tuple with the Apm field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IPRanges) GetApmOk() (*IPPrefixesAPM, bool) {
if o == nil || o.Apm == nil {
return nil, false
}
return o.Apm, true
}
// HasApm returns a boolean if a field has been set.
func (o *IPRanges) HasApm() bool {
return o != nil && o.Apm != nil
}
// SetApm gets a reference to the given IPPrefixesAPM and assigns it to the Apm field.
func (o *IPRanges) SetApm(v IPPrefixesAPM) {
o.Apm = &v
}
// GetGlobal returns the Global field value if set, zero value otherwise.
func (o *IPRanges) GetGlobal() IPPrefixesGlobal {
if o == nil || o.Global == nil {
var ret IPPrefixesGlobal
return ret
}
return *o.Global
}
// GetGlobalOk returns a tuple with the Global field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IPRanges) GetGlobalOk() (*IPPrefixesGlobal, bool) {
if o == nil || o.Global == nil {
return nil, false
}
return o.Global, true
}
// HasGlobal returns a boolean if a field has been set.
func (o *IPRanges) HasGlobal() bool {
return o != nil && o.Global != nil
}
// SetGlobal gets a reference to the given IPPrefixesGlobal and assigns it to the Global field.
func (o *IPRanges) SetGlobal(v IPPrefixesGlobal) {
o.Global = &v
}
// GetLogs returns the Logs field value if set, zero value otherwise.
func (o *IPRanges) GetLogs() IPPrefixesLogs {
if o == nil || o.Logs == nil {
var ret IPPrefixesLogs
return ret
}
return *o.Logs
}
// GetLogsOk returns a tuple with the Logs field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IPRanges) GetLogsOk() (*IPPrefixesLogs, bool) {
if o == nil || o.Logs == nil {
return nil, false
}
return o.Logs, true
}
// HasLogs returns a boolean if a field has been set.
func (o *IPRanges) HasLogs() bool {
return o != nil && o.Logs != nil
}
// SetLogs gets a reference to the given IPPrefixesLogs and assigns it to the Logs field.
func (o *IPRanges) SetLogs(v IPPrefixesLogs) {
o.Logs = &v
}
// GetModified returns the Modified field value if set, zero value otherwise.
func (o *IPRanges) GetModified() string {
if o == nil || o.Modified == nil {
var ret string
return ret
}
return *o.Modified
}
// GetModifiedOk returns a tuple with the Modified field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IPRanges) GetModifiedOk() (*string, bool) {
if o == nil || o.Modified == nil {
return nil, false
}
return o.Modified, true
}
// HasModified returns a boolean if a field has been set.
func (o *IPRanges) HasModified() bool {
return o != nil && o.Modified != nil
}
// SetModified gets a reference to the given string and assigns it to the Modified field.
func (o *IPRanges) SetModified(v string) {
o.Modified = &v
}
// GetOrchestrator returns the Orchestrator field value if set, zero value otherwise.
func (o *IPRanges) GetOrchestrator() IPPrefixesOrchestrator {
if o == nil || o.Orchestrator == nil {
var ret IPPrefixesOrchestrator
return ret
}
return *o.Orchestrator
}
// GetOrchestratorOk returns a tuple with the Orchestrator field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IPRanges) GetOrchestratorOk() (*IPPrefixesOrchestrator, bool) {
if o == nil || o.Orchestrator == nil {
return nil, false
}
return o.Orchestrator, true
}
// HasOrchestrator returns a boolean if a field has been set.
func (o *IPRanges) HasOrchestrator() bool {
return o != nil && o.Orchestrator != nil
}
// SetOrchestrator gets a reference to the given IPPrefixesOrchestrator and assigns it to the Orchestrator field.
func (o *IPRanges) SetOrchestrator(v IPPrefixesOrchestrator) {
o.Orchestrator = &v
}
// GetProcess returns the Process field value if set, zero value otherwise.
func (o *IPRanges) GetProcess() IPPrefixesProcess {
if o == nil || o.Process == nil {
var ret IPPrefixesProcess
return ret
}
return *o.Process
}
// GetProcessOk returns a tuple with the Process field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IPRanges) GetProcessOk() (*IPPrefixesProcess, bool) {
if o == nil || o.Process == nil {
return nil, false
}
return o.Process, true
}
// HasProcess returns a boolean if a field has been set.
func (o *IPRanges) HasProcess() bool {
return o != nil && o.Process != nil
}
// SetProcess gets a reference to the given IPPrefixesProcess and assigns it to the Process field.
func (o *IPRanges) SetProcess(v IPPrefixesProcess) {
o.Process = &v
}
// GetRemoteConfiguration returns the RemoteConfiguration field value if set, zero value otherwise.
func (o *IPRanges) GetRemoteConfiguration() IPPrefixesRemoteConfiguration {
if o == nil || o.RemoteConfiguration == nil {
var ret IPPrefixesRemoteConfiguration
return ret
}
return *o.RemoteConfiguration
}
// GetRemoteConfigurationOk returns a tuple with the RemoteConfiguration field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IPRanges) GetRemoteConfigurationOk() (*IPPrefixesRemoteConfiguration, bool) {
if o == nil || o.RemoteConfiguration == nil {
return nil, false
}
return o.RemoteConfiguration, true
}
// HasRemoteConfiguration returns a boolean if a field has been set.
func (o *IPRanges) HasRemoteConfiguration() bool {
return o != nil && o.RemoteConfiguration != nil
}
// SetRemoteConfiguration gets a reference to the given IPPrefixesRemoteConfiguration and assigns it to the RemoteConfiguration field.
func (o *IPRanges) SetRemoteConfiguration(v IPPrefixesRemoteConfiguration) {
o.RemoteConfiguration = &v
}
// GetSynthetics returns the Synthetics field value if set, zero value otherwise.
func (o *IPRanges) GetSynthetics() IPPrefixesSynthetics {
if o == nil || o.Synthetics == nil {
var ret IPPrefixesSynthetics
return ret
}
return *o.Synthetics
}
// GetSyntheticsOk returns a tuple with the Synthetics field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IPRanges) GetSyntheticsOk() (*IPPrefixesSynthetics, bool) {
if o == nil || o.Synthetics == nil {
return nil, false
}
return o.Synthetics, true
}
// HasSynthetics returns a boolean if a field has been set.
func (o *IPRanges) HasSynthetics() bool {
return o != nil && o.Synthetics != nil
}
// SetSynthetics gets a reference to the given IPPrefixesSynthetics and assigns it to the Synthetics field.
func (o *IPRanges) SetSynthetics(v IPPrefixesSynthetics) {
o.Synthetics = &v
}
// GetSyntheticsPrivateLocations returns the SyntheticsPrivateLocations field value if set, zero value otherwise.
func (o *IPRanges) GetSyntheticsPrivateLocations() IPPrefixesSyntheticsPrivateLocations {
if o == nil || o.SyntheticsPrivateLocations == nil {
var ret IPPrefixesSyntheticsPrivateLocations
return ret
}
return *o.SyntheticsPrivateLocations
}
// GetSyntheticsPrivateLocationsOk returns a tuple with the SyntheticsPrivateLocations field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IPRanges) GetSyntheticsPrivateLocationsOk() (*IPPrefixesSyntheticsPrivateLocations, bool) {
if o == nil || o.SyntheticsPrivateLocations == nil {
return nil, false
}
return o.SyntheticsPrivateLocations, true
}
// HasSyntheticsPrivateLocations returns a boolean if a field has been set.
func (o *IPRanges) HasSyntheticsPrivateLocations() bool {
return o != nil && o.SyntheticsPrivateLocations != nil
}
// SetSyntheticsPrivateLocations gets a reference to the given IPPrefixesSyntheticsPrivateLocations and assigns it to the SyntheticsPrivateLocations field.
func (o *IPRanges) SetSyntheticsPrivateLocations(v IPPrefixesSyntheticsPrivateLocations) {
o.SyntheticsPrivateLocations = &v
}
// GetVersion returns the Version field value if set, zero value otherwise.
func (o *IPRanges) GetVersion() int64 {
if o == nil || o.Version == nil {
var ret int64
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 *IPRanges) GetVersionOk() (*int64, bool) {
if o == nil || o.Version == nil {
return nil, false
}
return o.Version, true
}
// HasVersion returns a boolean if a field has been set.
func (o *IPRanges) HasVersion() bool {
return o != nil && o.Version != nil
}
// SetVersion gets a reference to the given int64 and assigns it to the Version field.
func (o *IPRanges) SetVersion(v int64) {
o.Version = &v
}
// GetWebhooks returns the Webhooks field value if set, zero value otherwise.
func (o *IPRanges) GetWebhooks() IPPrefixesWebhooks {
if o == nil || o.Webhooks == nil {
var ret IPPrefixesWebhooks
return ret
}
return *o.Webhooks
}
// GetWebhooksOk returns a tuple with the Webhooks field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IPRanges) GetWebhooksOk() (*IPPrefixesWebhooks, bool) {
if o == nil || o.Webhooks == nil {
return nil, false
}
return o.Webhooks, true
}
// HasWebhooks returns a boolean if a field has been set.
func (o *IPRanges) HasWebhooks() bool {
return o != nil && o.Webhooks != nil
}
// SetWebhooks gets a reference to the given IPPrefixesWebhooks and assigns it to the Webhooks field.
func (o *IPRanges) SetWebhooks(v IPPrefixesWebhooks) {
o.Webhooks = &v
}
// MarshalJSON serializes the struct using spec logic.
func (o IPRanges) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.UnparsedObject != nil {
return datadog.Marshal(o.UnparsedObject)
}
if o.Agents != nil {
toSerialize["agents"] = o.Agents
}
if o.Api != nil {
toSerialize["api"] = o.Api
}
if o.Apm != nil {
toSerialize["apm"] = o.Apm
}
if o.Global != nil {
toSerialize["global"] = o.Global
}
if o.Logs != nil {
toSerialize["logs"] = o.Logs
}
if o.Modified != nil {
toSerialize["modified"] = o.Modified
}
if o.Orchestrator != nil {
toSerialize["orchestrator"] = o.Orchestrator
}
if o.Process != nil {
toSerialize["process"] = o.Process
}
if o.RemoteConfiguration != nil {
toSerialize["remote-configuration"] = o.RemoteConfiguration
}
if o.Synthetics != nil {
toSerialize["synthetics"] = o.Synthetics
}
if o.SyntheticsPrivateLocations != nil {
toSerialize["synthetics-private-locations"] = o.SyntheticsPrivateLocations
}
if o.Version != nil {
toSerialize["version"] = o.Version
}
if o.Webhooks != nil {
toSerialize["webhooks"] = o.Webhooks
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return datadog.Marshal(toSerialize)
}
// UnmarshalJSON deserializes the given payload.
func (o *IPRanges) UnmarshalJSON(bytes []byte) (err error) {
all := struct {
Agents *IPPrefixesAgents `json:"agents,omitempty"`
Api *IPPrefixesAPI `json:"api,omitempty"`
Apm *IPPrefixesAPM `json:"apm,omitempty"`
Global *IPPrefixesGlobal `json:"global,omitempty"`
Logs *IPPrefixesLogs `json:"logs,omitempty"`
Modified *string `json:"modified,omitempty"`
Orchestrator *IPPrefixesOrchestrator `json:"orchestrator,omitempty"`
Process *IPPrefixesProcess `json:"process,omitempty"`
RemoteConfiguration *IPPrefixesRemoteConfiguration `json:"remote-configuration,omitempty"`
Synthetics *IPPrefixesSynthetics `json:"synthetics,omitempty"`
SyntheticsPrivateLocations *IPPrefixesSyntheticsPrivateLocations `json:"synthetics-private-locations,omitempty"`
Version *int64 `json:"version,omitempty"`
Webhooks *IPPrefixesWebhooks `json:"webhooks,omitempty"`
}{}
if err = datadog.Unmarshal(bytes, &all); err != nil {
return datadog.Unmarshal(bytes, &o.UnparsedObject)
}
additionalProperties := make(map[string]interface{})
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
datadog.DeleteKeys(additionalProperties, &[]string{"agents", "api", "apm", "global", "logs", "modified", "orchestrator", "process", "remote-configuration", "synthetics", "synthetics-private-locations", "version", "webhooks"})
} else {
return err
}
hasInvalidField := false
if all.Agents != nil && all.Agents.UnparsedObject != nil && o.UnparsedObject == nil {
hasInvalidField = true
}
o.Agents = all.Agents
if all.Api != nil && all.Api.UnparsedObject != nil && o.UnparsedObject == nil {
hasInvalidField = true
}
o.Api = all.Api
if all.Apm != nil && all.Apm.UnparsedObject != nil && o.UnparsedObject == nil {
hasInvalidField = true
}
o.Apm = all.Apm
if all.Global != nil && all.Global.UnparsedObject != nil && o.UnparsedObject == nil {
hasInvalidField = true
}
o.Global = all.Global
if all.Logs != nil && all.Logs.UnparsedObject != nil && o.UnparsedObject == nil {
hasInvalidField = true
}
o.Logs = all.Logs
o.Modified = all.Modified
if all.Orchestrator != nil && all.Orchestrator.UnparsedObject != nil && o.UnparsedObject == nil {
hasInvalidField = true
}
o.Orchestrator = all.Orchestrator
if all.Process != nil && all.Process.UnparsedObject != nil && o.UnparsedObject == nil {
hasInvalidField = true
}
o.Process = all.Process
if all.RemoteConfiguration != nil && all.RemoteConfiguration.UnparsedObject != nil && o.UnparsedObject == nil {
hasInvalidField = true
}
o.RemoteConfiguration = all.RemoteConfiguration
if all.Synthetics != nil && all.Synthetics.UnparsedObject != nil && o.UnparsedObject == nil {
hasInvalidField = true
}
o.Synthetics = all.Synthetics
if all.SyntheticsPrivateLocations != nil && all.SyntheticsPrivateLocations.UnparsedObject != nil && o.UnparsedObject == nil {
hasInvalidField = true
}
o.SyntheticsPrivateLocations = all.SyntheticsPrivateLocations
o.Version = all.Version
if all.Webhooks != nil && all.Webhooks.UnparsedObject != nil && o.UnparsedObject == nil {
hasInvalidField = true
}
o.Webhooks = all.Webhooks
if len(additionalProperties) > 0 {
o.AdditionalProperties = additionalProperties
}
if hasInvalidField {
return datadog.Unmarshal(bytes, &o.UnparsedObject)
}
return nil
}