-
Notifications
You must be signed in to change notification settings - Fork 52
/
model_gcp_account.go
669 lines (591 loc) · 23 KB
/
model_gcp_account.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
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
// 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"
)
// GCPAccount Your Google Cloud Platform Account.
type GCPAccount struct {
// Should be `https://www.googleapis.com/oauth2/v1/certs`.
AuthProviderX509CertUrl *string `json:"auth_provider_x509_cert_url,omitempty"`
// Should be `https://accounts.google.com/o/oauth2/auth`.
AuthUri *string `json:"auth_uri,omitempty"`
// Silence monitors for expected GCE instance shutdowns.
Automute *bool `json:"automute,omitempty"`
// Your email found in your JSON service account key.
ClientEmail *string `json:"client_email,omitempty"`
// Your ID found in your JSON service account key.
ClientId *string `json:"client_id,omitempty"`
// Should be `https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL`
// where `$CLIENT_EMAIL` is the email found in your JSON service account key.
ClientX509CertUrl *string `json:"client_x509_cert_url,omitempty"`
// Limit the Cloud Run revisions that are pulled into Datadog by using tags.
// Only Cloud Run revision resources that apply to specified filters are imported into Datadog.
CloudRunRevisionFilters []string `json:"cloud_run_revision_filters,omitempty"`
// An array of errors.
Errors []string `json:"errors,omitempty"`
// Limit the GCE instances that are pulled into Datadog by using tags.
// Only hosts that match one of the defined tags are imported into Datadog.
HostFilters *string `json:"host_filters,omitempty"`
// When enabled, Datadog will activate the Cloud Security Monitoring product for this service account. Note: This requires resource_collection_enabled to be set to true.
IsCspmEnabled *bool `json:"is_cspm_enabled,omitempty"`
// When enabled, Datadog will attempt to collect Security Command Center Findings. Note: This requires additional permissions on the service account.
IsSecurityCommandCenterEnabled *bool `json:"is_security_command_center_enabled,omitempty"`
// Your private key name found in your JSON service account key.
PrivateKey *string `json:"private_key,omitempty"`
// Your private key ID found in your JSON service account key.
PrivateKeyId *string `json:"private_key_id,omitempty"`
// Your Google Cloud project ID found in your JSON service account key.
ProjectId *string `json:"project_id,omitempty"`
// When enabled, Datadog scans for all resources in your GCP environment.
ResourceCollectionEnabled *bool `json:"resource_collection_enabled,omitempty"`
// Should be `https://accounts.google.com/o/oauth2/token`.
TokenUri *string `json:"token_uri,omitempty"`
// The value for service_account found in your JSON service account key.
Type *string `json:"type,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{}
}
// NewGCPAccount instantiates a new GCPAccount 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 NewGCPAccount() *GCPAccount {
this := GCPAccount{}
var isSecurityCommandCenterEnabled bool = false
this.IsSecurityCommandCenterEnabled = &isSecurityCommandCenterEnabled
return &this
}
// NewGCPAccountWithDefaults instantiates a new GCPAccount 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 NewGCPAccountWithDefaults() *GCPAccount {
this := GCPAccount{}
var isSecurityCommandCenterEnabled bool = false
this.IsSecurityCommandCenterEnabled = &isSecurityCommandCenterEnabled
return &this
}
// GetAuthProviderX509CertUrl returns the AuthProviderX509CertUrl field value if set, zero value otherwise.
func (o *GCPAccount) GetAuthProviderX509CertUrl() string {
if o == nil || o.AuthProviderX509CertUrl == nil {
var ret string
return ret
}
return *o.AuthProviderX509CertUrl
}
// GetAuthProviderX509CertUrlOk returns a tuple with the AuthProviderX509CertUrl field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GCPAccount) GetAuthProviderX509CertUrlOk() (*string, bool) {
if o == nil || o.AuthProviderX509CertUrl == nil {
return nil, false
}
return o.AuthProviderX509CertUrl, true
}
// HasAuthProviderX509CertUrl returns a boolean if a field has been set.
func (o *GCPAccount) HasAuthProviderX509CertUrl() bool {
return o != nil && o.AuthProviderX509CertUrl != nil
}
// SetAuthProviderX509CertUrl gets a reference to the given string and assigns it to the AuthProviderX509CertUrl field.
func (o *GCPAccount) SetAuthProviderX509CertUrl(v string) {
o.AuthProviderX509CertUrl = &v
}
// GetAuthUri returns the AuthUri field value if set, zero value otherwise.
func (o *GCPAccount) GetAuthUri() string {
if o == nil || o.AuthUri == nil {
var ret string
return ret
}
return *o.AuthUri
}
// GetAuthUriOk returns a tuple with the AuthUri field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GCPAccount) GetAuthUriOk() (*string, bool) {
if o == nil || o.AuthUri == nil {
return nil, false
}
return o.AuthUri, true
}
// HasAuthUri returns a boolean if a field has been set.
func (o *GCPAccount) HasAuthUri() bool {
return o != nil && o.AuthUri != nil
}
// SetAuthUri gets a reference to the given string and assigns it to the AuthUri field.
func (o *GCPAccount) SetAuthUri(v string) {
o.AuthUri = &v
}
// GetAutomute returns the Automute field value if set, zero value otherwise.
func (o *GCPAccount) GetAutomute() bool {
if o == nil || o.Automute == nil {
var ret bool
return ret
}
return *o.Automute
}
// GetAutomuteOk returns a tuple with the Automute field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GCPAccount) GetAutomuteOk() (*bool, bool) {
if o == nil || o.Automute == nil {
return nil, false
}
return o.Automute, true
}
// HasAutomute returns a boolean if a field has been set.
func (o *GCPAccount) HasAutomute() bool {
return o != nil && o.Automute != nil
}
// SetAutomute gets a reference to the given bool and assigns it to the Automute field.
func (o *GCPAccount) SetAutomute(v bool) {
o.Automute = &v
}
// GetClientEmail returns the ClientEmail field value if set, zero value otherwise.
func (o *GCPAccount) GetClientEmail() string {
if o == nil || o.ClientEmail == nil {
var ret string
return ret
}
return *o.ClientEmail
}
// GetClientEmailOk returns a tuple with the ClientEmail field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GCPAccount) GetClientEmailOk() (*string, bool) {
if o == nil || o.ClientEmail == nil {
return nil, false
}
return o.ClientEmail, true
}
// HasClientEmail returns a boolean if a field has been set.
func (o *GCPAccount) HasClientEmail() bool {
return o != nil && o.ClientEmail != nil
}
// SetClientEmail gets a reference to the given string and assigns it to the ClientEmail field.
func (o *GCPAccount) SetClientEmail(v string) {
o.ClientEmail = &v
}
// GetClientId returns the ClientId field value if set, zero value otherwise.
func (o *GCPAccount) GetClientId() string {
if o == nil || o.ClientId == nil {
var ret string
return ret
}
return *o.ClientId
}
// GetClientIdOk returns a tuple with the ClientId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GCPAccount) GetClientIdOk() (*string, bool) {
if o == nil || o.ClientId == nil {
return nil, false
}
return o.ClientId, true
}
// HasClientId returns a boolean if a field has been set.
func (o *GCPAccount) HasClientId() bool {
return o != nil && o.ClientId != nil
}
// SetClientId gets a reference to the given string and assigns it to the ClientId field.
func (o *GCPAccount) SetClientId(v string) {
o.ClientId = &v
}
// GetClientX509CertUrl returns the ClientX509CertUrl field value if set, zero value otherwise.
func (o *GCPAccount) GetClientX509CertUrl() string {
if o == nil || o.ClientX509CertUrl == nil {
var ret string
return ret
}
return *o.ClientX509CertUrl
}
// GetClientX509CertUrlOk returns a tuple with the ClientX509CertUrl field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GCPAccount) GetClientX509CertUrlOk() (*string, bool) {
if o == nil || o.ClientX509CertUrl == nil {
return nil, false
}
return o.ClientX509CertUrl, true
}
// HasClientX509CertUrl returns a boolean if a field has been set.
func (o *GCPAccount) HasClientX509CertUrl() bool {
return o != nil && o.ClientX509CertUrl != nil
}
// SetClientX509CertUrl gets a reference to the given string and assigns it to the ClientX509CertUrl field.
func (o *GCPAccount) SetClientX509CertUrl(v string) {
o.ClientX509CertUrl = &v
}
// GetCloudRunRevisionFilters returns the CloudRunRevisionFilters field value if set, zero value otherwise.
func (o *GCPAccount) GetCloudRunRevisionFilters() []string {
if o == nil || o.CloudRunRevisionFilters == nil {
var ret []string
return ret
}
return o.CloudRunRevisionFilters
}
// GetCloudRunRevisionFiltersOk returns a tuple with the CloudRunRevisionFilters field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GCPAccount) GetCloudRunRevisionFiltersOk() (*[]string, bool) {
if o == nil || o.CloudRunRevisionFilters == nil {
return nil, false
}
return &o.CloudRunRevisionFilters, true
}
// HasCloudRunRevisionFilters returns a boolean if a field has been set.
func (o *GCPAccount) HasCloudRunRevisionFilters() bool {
return o != nil && o.CloudRunRevisionFilters != nil
}
// SetCloudRunRevisionFilters gets a reference to the given []string and assigns it to the CloudRunRevisionFilters field.
func (o *GCPAccount) SetCloudRunRevisionFilters(v []string) {
o.CloudRunRevisionFilters = v
}
// GetErrors returns the Errors field value if set, zero value otherwise.
func (o *GCPAccount) GetErrors() []string {
if o == nil || o.Errors == nil {
var ret []string
return ret
}
return o.Errors
}
// GetErrorsOk returns a tuple with the Errors field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GCPAccount) GetErrorsOk() (*[]string, bool) {
if o == nil || o.Errors == nil {
return nil, false
}
return &o.Errors, true
}
// HasErrors returns a boolean if a field has been set.
func (o *GCPAccount) HasErrors() bool {
return o != nil && o.Errors != nil
}
// SetErrors gets a reference to the given []string and assigns it to the Errors field.
func (o *GCPAccount) SetErrors(v []string) {
o.Errors = v
}
// GetHostFilters returns the HostFilters field value if set, zero value otherwise.
func (o *GCPAccount) GetHostFilters() string {
if o == nil || o.HostFilters == nil {
var ret string
return ret
}
return *o.HostFilters
}
// GetHostFiltersOk returns a tuple with the HostFilters field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GCPAccount) GetHostFiltersOk() (*string, bool) {
if o == nil || o.HostFilters == nil {
return nil, false
}
return o.HostFilters, true
}
// HasHostFilters returns a boolean if a field has been set.
func (o *GCPAccount) HasHostFilters() bool {
return o != nil && o.HostFilters != nil
}
// SetHostFilters gets a reference to the given string and assigns it to the HostFilters field.
func (o *GCPAccount) SetHostFilters(v string) {
o.HostFilters = &v
}
// GetIsCspmEnabled returns the IsCspmEnabled field value if set, zero value otherwise.
func (o *GCPAccount) GetIsCspmEnabled() bool {
if o == nil || o.IsCspmEnabled == nil {
var ret bool
return ret
}
return *o.IsCspmEnabled
}
// GetIsCspmEnabledOk returns a tuple with the IsCspmEnabled field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GCPAccount) GetIsCspmEnabledOk() (*bool, bool) {
if o == nil || o.IsCspmEnabled == nil {
return nil, false
}
return o.IsCspmEnabled, true
}
// HasIsCspmEnabled returns a boolean if a field has been set.
func (o *GCPAccount) HasIsCspmEnabled() bool {
return o != nil && o.IsCspmEnabled != nil
}
// SetIsCspmEnabled gets a reference to the given bool and assigns it to the IsCspmEnabled field.
func (o *GCPAccount) SetIsCspmEnabled(v bool) {
o.IsCspmEnabled = &v
}
// GetIsSecurityCommandCenterEnabled returns the IsSecurityCommandCenterEnabled field value if set, zero value otherwise.
func (o *GCPAccount) GetIsSecurityCommandCenterEnabled() bool {
if o == nil || o.IsSecurityCommandCenterEnabled == nil {
var ret bool
return ret
}
return *o.IsSecurityCommandCenterEnabled
}
// GetIsSecurityCommandCenterEnabledOk returns a tuple with the IsSecurityCommandCenterEnabled field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GCPAccount) GetIsSecurityCommandCenterEnabledOk() (*bool, bool) {
if o == nil || o.IsSecurityCommandCenterEnabled == nil {
return nil, false
}
return o.IsSecurityCommandCenterEnabled, true
}
// HasIsSecurityCommandCenterEnabled returns a boolean if a field has been set.
func (o *GCPAccount) HasIsSecurityCommandCenterEnabled() bool {
return o != nil && o.IsSecurityCommandCenterEnabled != nil
}
// SetIsSecurityCommandCenterEnabled gets a reference to the given bool and assigns it to the IsSecurityCommandCenterEnabled field.
func (o *GCPAccount) SetIsSecurityCommandCenterEnabled(v bool) {
o.IsSecurityCommandCenterEnabled = &v
}
// GetPrivateKey returns the PrivateKey field value if set, zero value otherwise.
func (o *GCPAccount) GetPrivateKey() string {
if o == nil || o.PrivateKey == nil {
var ret string
return ret
}
return *o.PrivateKey
}
// GetPrivateKeyOk returns a tuple with the PrivateKey field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GCPAccount) GetPrivateKeyOk() (*string, bool) {
if o == nil || o.PrivateKey == nil {
return nil, false
}
return o.PrivateKey, true
}
// HasPrivateKey returns a boolean if a field has been set.
func (o *GCPAccount) HasPrivateKey() bool {
return o != nil && o.PrivateKey != nil
}
// SetPrivateKey gets a reference to the given string and assigns it to the PrivateKey field.
func (o *GCPAccount) SetPrivateKey(v string) {
o.PrivateKey = &v
}
// GetPrivateKeyId returns the PrivateKeyId field value if set, zero value otherwise.
func (o *GCPAccount) GetPrivateKeyId() string {
if o == nil || o.PrivateKeyId == nil {
var ret string
return ret
}
return *o.PrivateKeyId
}
// GetPrivateKeyIdOk returns a tuple with the PrivateKeyId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GCPAccount) GetPrivateKeyIdOk() (*string, bool) {
if o == nil || o.PrivateKeyId == nil {
return nil, false
}
return o.PrivateKeyId, true
}
// HasPrivateKeyId returns a boolean if a field has been set.
func (o *GCPAccount) HasPrivateKeyId() bool {
return o != nil && o.PrivateKeyId != nil
}
// SetPrivateKeyId gets a reference to the given string and assigns it to the PrivateKeyId field.
func (o *GCPAccount) SetPrivateKeyId(v string) {
o.PrivateKeyId = &v
}
// GetProjectId returns the ProjectId field value if set, zero value otherwise.
func (o *GCPAccount) GetProjectId() string {
if o == nil || o.ProjectId == nil {
var ret string
return ret
}
return *o.ProjectId
}
// GetProjectIdOk returns a tuple with the ProjectId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GCPAccount) GetProjectIdOk() (*string, bool) {
if o == nil || o.ProjectId == nil {
return nil, false
}
return o.ProjectId, true
}
// HasProjectId returns a boolean if a field has been set.
func (o *GCPAccount) HasProjectId() bool {
return o != nil && o.ProjectId != nil
}
// SetProjectId gets a reference to the given string and assigns it to the ProjectId field.
func (o *GCPAccount) SetProjectId(v string) {
o.ProjectId = &v
}
// GetResourceCollectionEnabled returns the ResourceCollectionEnabled field value if set, zero value otherwise.
func (o *GCPAccount) GetResourceCollectionEnabled() bool {
if o == nil || o.ResourceCollectionEnabled == nil {
var ret bool
return ret
}
return *o.ResourceCollectionEnabled
}
// GetResourceCollectionEnabledOk returns a tuple with the ResourceCollectionEnabled field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GCPAccount) GetResourceCollectionEnabledOk() (*bool, bool) {
if o == nil || o.ResourceCollectionEnabled == nil {
return nil, false
}
return o.ResourceCollectionEnabled, true
}
// HasResourceCollectionEnabled returns a boolean if a field has been set.
func (o *GCPAccount) HasResourceCollectionEnabled() bool {
return o != nil && o.ResourceCollectionEnabled != nil
}
// SetResourceCollectionEnabled gets a reference to the given bool and assigns it to the ResourceCollectionEnabled field.
func (o *GCPAccount) SetResourceCollectionEnabled(v bool) {
o.ResourceCollectionEnabled = &v
}
// GetTokenUri returns the TokenUri field value if set, zero value otherwise.
func (o *GCPAccount) GetTokenUri() string {
if o == nil || o.TokenUri == nil {
var ret string
return ret
}
return *o.TokenUri
}
// GetTokenUriOk returns a tuple with the TokenUri field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GCPAccount) GetTokenUriOk() (*string, bool) {
if o == nil || o.TokenUri == nil {
return nil, false
}
return o.TokenUri, true
}
// HasTokenUri returns a boolean if a field has been set.
func (o *GCPAccount) HasTokenUri() bool {
return o != nil && o.TokenUri != nil
}
// SetTokenUri gets a reference to the given string and assigns it to the TokenUri field.
func (o *GCPAccount) SetTokenUri(v string) {
o.TokenUri = &v
}
// GetType returns the Type field value if set, zero value otherwise.
func (o *GCPAccount) GetType() string {
if o == nil || o.Type == nil {
var ret string
return ret
}
return *o.Type
}
// GetTypeOk returns a tuple with the Type field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GCPAccount) GetTypeOk() (*string, bool) {
if o == nil || o.Type == nil {
return nil, false
}
return o.Type, true
}
// HasType returns a boolean if a field has been set.
func (o *GCPAccount) HasType() bool {
return o != nil && o.Type != nil
}
// SetType gets a reference to the given string and assigns it to the Type field.
func (o *GCPAccount) SetType(v string) {
o.Type = &v
}
// MarshalJSON serializes the struct using spec logic.
func (o GCPAccount) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.UnparsedObject != nil {
return datadog.Marshal(o.UnparsedObject)
}
if o.AuthProviderX509CertUrl != nil {
toSerialize["auth_provider_x509_cert_url"] = o.AuthProviderX509CertUrl
}
if o.AuthUri != nil {
toSerialize["auth_uri"] = o.AuthUri
}
if o.Automute != nil {
toSerialize["automute"] = o.Automute
}
if o.ClientEmail != nil {
toSerialize["client_email"] = o.ClientEmail
}
if o.ClientId != nil {
toSerialize["client_id"] = o.ClientId
}
if o.ClientX509CertUrl != nil {
toSerialize["client_x509_cert_url"] = o.ClientX509CertUrl
}
if o.CloudRunRevisionFilters != nil {
toSerialize["cloud_run_revision_filters"] = o.CloudRunRevisionFilters
}
if o.Errors != nil {
toSerialize["errors"] = o.Errors
}
if o.HostFilters != nil {
toSerialize["host_filters"] = o.HostFilters
}
if o.IsCspmEnabled != nil {
toSerialize["is_cspm_enabled"] = o.IsCspmEnabled
}
if o.IsSecurityCommandCenterEnabled != nil {
toSerialize["is_security_command_center_enabled"] = o.IsSecurityCommandCenterEnabled
}
if o.PrivateKey != nil {
toSerialize["private_key"] = o.PrivateKey
}
if o.PrivateKeyId != nil {
toSerialize["private_key_id"] = o.PrivateKeyId
}
if o.ProjectId != nil {
toSerialize["project_id"] = o.ProjectId
}
if o.ResourceCollectionEnabled != nil {
toSerialize["resource_collection_enabled"] = o.ResourceCollectionEnabled
}
if o.TokenUri != nil {
toSerialize["token_uri"] = o.TokenUri
}
if o.Type != nil {
toSerialize["type"] = o.Type
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return datadog.Marshal(toSerialize)
}
// UnmarshalJSON deserializes the given payload.
func (o *GCPAccount) UnmarshalJSON(bytes []byte) (err error) {
all := struct {
AuthProviderX509CertUrl *string `json:"auth_provider_x509_cert_url,omitempty"`
AuthUri *string `json:"auth_uri,omitempty"`
Automute *bool `json:"automute,omitempty"`
ClientEmail *string `json:"client_email,omitempty"`
ClientId *string `json:"client_id,omitempty"`
ClientX509CertUrl *string `json:"client_x509_cert_url,omitempty"`
CloudRunRevisionFilters []string `json:"cloud_run_revision_filters,omitempty"`
Errors []string `json:"errors,omitempty"`
HostFilters *string `json:"host_filters,omitempty"`
IsCspmEnabled *bool `json:"is_cspm_enabled,omitempty"`
IsSecurityCommandCenterEnabled *bool `json:"is_security_command_center_enabled,omitempty"`
PrivateKey *string `json:"private_key,omitempty"`
PrivateKeyId *string `json:"private_key_id,omitempty"`
ProjectId *string `json:"project_id,omitempty"`
ResourceCollectionEnabled *bool `json:"resource_collection_enabled,omitempty"`
TokenUri *string `json:"token_uri,omitempty"`
Type *string `json:"type,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{"auth_provider_x509_cert_url", "auth_uri", "automute", "client_email", "client_id", "client_x509_cert_url", "cloud_run_revision_filters", "errors", "host_filters", "is_cspm_enabled", "is_security_command_center_enabled", "private_key", "private_key_id", "project_id", "resource_collection_enabled", "token_uri", "type"})
} else {
return err
}
o.AuthProviderX509CertUrl = all.AuthProviderX509CertUrl
o.AuthUri = all.AuthUri
o.Automute = all.Automute
o.ClientEmail = all.ClientEmail
o.ClientId = all.ClientId
o.ClientX509CertUrl = all.ClientX509CertUrl
o.CloudRunRevisionFilters = all.CloudRunRevisionFilters
o.Errors = all.Errors
o.HostFilters = all.HostFilters
o.IsCspmEnabled = all.IsCspmEnabled
o.IsSecurityCommandCenterEnabled = all.IsSecurityCommandCenterEnabled
o.PrivateKey = all.PrivateKey
o.PrivateKeyId = all.PrivateKeyId
o.ProjectId = all.ProjectId
o.ResourceCollectionEnabled = all.ResourceCollectionEnabled
o.TokenUri = all.TokenUri
o.Type = all.Type
if len(additionalProperties) > 0 {
o.AdditionalProperties = additionalProperties
}
return nil
}