Skip to content

Commit ca53a34

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
and
ci.datadog-api-spec
authored
add mfa_enabled field and change created_at type to datetime (#2615)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com> Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
1 parent fdf2f50 commit ca53a34

File tree

4 files changed

+59
-13
lines changed

4 files changed

+59
-13
lines changed

.apigentools-info

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2024-08-09 16:10:45.310669",
8-
"spec_repo_commit": "4a0f9e08"
7+
"regenerated": "2024-08-12 13:34:54.556770",
8+
"spec_repo_commit": "0360f6c8"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-08-09 16:10:45.328777",
13-
"spec_repo_commit": "4a0f9e08"
12+
"regenerated": "2024-08-12 13:34:54.576362",
13+
"spec_repo_commit": "0360f6c8"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -8496,6 +8496,7 @@ components:
84968496
created_at:
84978497
description: Creation date of the application key.
84988498
example: '2020-11-23T10:00:00.000Z'
8499+
format: date-time
84998500
readOnly: true
85008501
type: string
85018502
key:
@@ -23415,6 +23416,10 @@ components:
2341523416
icon:
2341623417
description: URL of the user's icon.
2341723418
type: string
23419+
mfa_enabled:
23420+
description: If user has MFA enabled.
23421+
readOnly: true
23422+
type: boolean
2341823423
modified_at:
2341923424
description: Time that the user was last modified.
2342023425
format: date-time

api/datadogV2/model_full_application_key_attributes.go

+14-8
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@
55
package datadogV2
66

77
import (
8+
"time"
9+
810
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
911
)
1012

1113
// FullApplicationKeyAttributes Attributes of a full application key.
1214
type FullApplicationKeyAttributes struct {
1315
// Creation date of the application key.
14-
CreatedAt *string `json:"created_at,omitempty"`
16+
CreatedAt *time.Time `json:"created_at,omitempty"`
1517
// The application key.
1618
Key *string `json:"key,omitempty"`
1719
// The last four characters of the application key.
@@ -43,17 +45,17 @@ func NewFullApplicationKeyAttributesWithDefaults() *FullApplicationKeyAttributes
4345
}
4446

4547
// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise.
46-
func (o *FullApplicationKeyAttributes) GetCreatedAt() string {
48+
func (o *FullApplicationKeyAttributes) GetCreatedAt() time.Time {
4749
if o == nil || o.CreatedAt == nil {
48-
var ret string
50+
var ret time.Time
4951
return ret
5052
}
5153
return *o.CreatedAt
5254
}
5355

5456
// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise
5557
// and a boolean to check if the value has been set.
56-
func (o *FullApplicationKeyAttributes) GetCreatedAtOk() (*string, bool) {
58+
func (o *FullApplicationKeyAttributes) GetCreatedAtOk() (*time.Time, bool) {
5759
if o == nil || o.CreatedAt == nil {
5860
return nil, false
5961
}
@@ -65,8 +67,8 @@ func (o *FullApplicationKeyAttributes) HasCreatedAt() bool {
6567
return o != nil && o.CreatedAt != nil
6668
}
6769

68-
// SetCreatedAt gets a reference to the given string and assigns it to the CreatedAt field.
69-
func (o *FullApplicationKeyAttributes) SetCreatedAt(v string) {
70+
// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field.
71+
func (o *FullApplicationKeyAttributes) SetCreatedAt(v time.Time) {
7072
o.CreatedAt = &v
7173
}
7274

@@ -200,7 +202,11 @@ func (o FullApplicationKeyAttributes) MarshalJSON() ([]byte, error) {
200202
return datadog.Marshal(o.UnparsedObject)
201203
}
202204
if o.CreatedAt != nil {
203-
toSerialize["created_at"] = o.CreatedAt
205+
if o.CreatedAt.Nanosecond() == 0 {
206+
toSerialize["created_at"] = o.CreatedAt.Format("2006-01-02T15:04:05Z07:00")
207+
} else {
208+
toSerialize["created_at"] = o.CreatedAt.Format("2006-01-02T15:04:05.000Z07:00")
209+
}
204210
}
205211
if o.Key != nil {
206212
toSerialize["key"] = o.Key
@@ -224,7 +230,7 @@ func (o FullApplicationKeyAttributes) MarshalJSON() ([]byte, error) {
224230
// UnmarshalJSON deserializes the given payload.
225231
func (o *FullApplicationKeyAttributes) UnmarshalJSON(bytes []byte) (err error) {
226232
all := struct {
227-
CreatedAt *string `json:"created_at,omitempty"`
233+
CreatedAt *time.Time `json:"created_at,omitempty"`
228234
Key *string `json:"key,omitempty"`
229235
Last4 *string `json:"last4,omitempty"`
230236
Name *string `json:"name,omitempty"`

api/datadogV2/model_user_attributes.go

+36-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ type UserAttributes struct {
2222
Handle *string `json:"handle,omitempty"`
2323
// URL of the user's icon.
2424
Icon *string `json:"icon,omitempty"`
25+
// If user has MFA enabled.
26+
MfaEnabled *bool `json:"mfa_enabled,omitempty"`
2527
// Time that the user was last modified.
2628
ModifiedAt *time.Time `json:"modified_at,omitempty"`
2729
// Name of the user.
@@ -196,6 +198,34 @@ func (o *UserAttributes) SetIcon(v string) {
196198
o.Icon = &v
197199
}
198200

201+
// GetMfaEnabled returns the MfaEnabled field value if set, zero value otherwise.
202+
func (o *UserAttributes) GetMfaEnabled() bool {
203+
if o == nil || o.MfaEnabled == nil {
204+
var ret bool
205+
return ret
206+
}
207+
return *o.MfaEnabled
208+
}
209+
210+
// GetMfaEnabledOk returns a tuple with the MfaEnabled field value if set, nil otherwise
211+
// and a boolean to check if the value has been set.
212+
func (o *UserAttributes) GetMfaEnabledOk() (*bool, bool) {
213+
if o == nil || o.MfaEnabled == nil {
214+
return nil, false
215+
}
216+
return o.MfaEnabled, true
217+
}
218+
219+
// HasMfaEnabled returns a boolean if a field has been set.
220+
func (o *UserAttributes) HasMfaEnabled() bool {
221+
return o != nil && o.MfaEnabled != nil
222+
}
223+
224+
// SetMfaEnabled gets a reference to the given bool and assigns it to the MfaEnabled field.
225+
func (o *UserAttributes) SetMfaEnabled(v bool) {
226+
o.MfaEnabled = &v
227+
}
228+
199229
// GetModifiedAt returns the ModifiedAt field value if set, zero value otherwise.
200230
func (o *UserAttributes) GetModifiedAt() time.Time {
201231
if o == nil || o.ModifiedAt == nil {
@@ -411,6 +441,9 @@ func (o UserAttributes) MarshalJSON() ([]byte, error) {
411441
if o.Icon != nil {
412442
toSerialize["icon"] = o.Icon
413443
}
444+
if o.MfaEnabled != nil {
445+
toSerialize["mfa_enabled"] = o.MfaEnabled
446+
}
414447
if o.ModifiedAt != nil {
415448
if o.ModifiedAt.Nanosecond() == 0 {
416449
toSerialize["modified_at"] = o.ModifiedAt.Format("2006-01-02T15:04:05Z07:00")
@@ -448,6 +481,7 @@ func (o *UserAttributes) UnmarshalJSON(bytes []byte) (err error) {
448481
Email *string `json:"email,omitempty"`
449482
Handle *string `json:"handle,omitempty"`
450483
Icon *string `json:"icon,omitempty"`
484+
MfaEnabled *bool `json:"mfa_enabled,omitempty"`
451485
ModifiedAt *time.Time `json:"modified_at,omitempty"`
452486
Name datadog.NullableString `json:"name,omitempty"`
453487
ServiceAccount *bool `json:"service_account,omitempty"`
@@ -460,7 +494,7 @@ func (o *UserAttributes) UnmarshalJSON(bytes []byte) (err error) {
460494
}
461495
additionalProperties := make(map[string]interface{})
462496
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
463-
datadog.DeleteKeys(additionalProperties, &[]string{"created_at", "disabled", "email", "handle", "icon", "modified_at", "name", "service_account", "status", "title", "verified"})
497+
datadog.DeleteKeys(additionalProperties, &[]string{"created_at", "disabled", "email", "handle", "icon", "mfa_enabled", "modified_at", "name", "service_account", "status", "title", "verified"})
464498
} else {
465499
return err
466500
}
@@ -469,6 +503,7 @@ func (o *UserAttributes) UnmarshalJSON(bytes []byte) (err error) {
469503
o.Email = all.Email
470504
o.Handle = all.Handle
471505
o.Icon = all.Icon
506+
o.MfaEnabled = all.MfaEnabled
472507
o.ModifiedAt = all.ModifiedAt
473508
o.Name = all.Name
474509
o.ServiceAccount = all.ServiceAccount

0 commit comments

Comments
 (0)