Skip to content

Commit

Permalink
add mfa_enabled field and change created_at type to datetime (#2615)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
api-clients-generation-pipeline[bot] and ci.datadog-api-spec committed Aug 12, 2024
1 parent fdf2f50 commit ca53a34
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 13 deletions.
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2024-08-09 16:10:45.310669",
"spec_repo_commit": "4a0f9e08"
"regenerated": "2024-08-12 13:34:54.556770",
"spec_repo_commit": "0360f6c8"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-08-09 16:10:45.328777",
"spec_repo_commit": "4a0f9e08"
"regenerated": "2024-08-12 13:34:54.576362",
"spec_repo_commit": "0360f6c8"
}
}
}
5 changes: 5 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8496,6 +8496,7 @@ components:
created_at:
description: Creation date of the application key.
example: '2020-11-23T10:00:00.000Z'
format: date-time
readOnly: true
type: string
key:
Expand Down Expand Up @@ -23415,6 +23416,10 @@ components:
icon:
description: URL of the user's icon.
type: string
mfa_enabled:
description: If user has MFA enabled.
readOnly: true
type: boolean
modified_at:
description: Time that the user was last modified.
format: date-time
Expand Down
22 changes: 14 additions & 8 deletions api/datadogV2/model_full_application_key_attributes.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
package datadogV2

import (
"time"

"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
)

// FullApplicationKeyAttributes Attributes of a full application key.
type FullApplicationKeyAttributes struct {
// Creation date of the application key.
CreatedAt *string `json:"created_at,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"`
// The application key.
Key *string `json:"key,omitempty"`
// The last four characters of the application key.
Expand Down Expand Up @@ -43,17 +45,17 @@ func NewFullApplicationKeyAttributesWithDefaults() *FullApplicationKeyAttributes
}

// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise.
func (o *FullApplicationKeyAttributes) GetCreatedAt() string {
func (o *FullApplicationKeyAttributes) GetCreatedAt() time.Time {
if o == nil || o.CreatedAt == nil {
var ret string
var ret time.Time
return ret
}
return *o.CreatedAt
}

// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FullApplicationKeyAttributes) GetCreatedAtOk() (*string, bool) {
func (o *FullApplicationKeyAttributes) GetCreatedAtOk() (*time.Time, bool) {
if o == nil || o.CreatedAt == nil {
return nil, false
}
Expand All @@ -65,8 +67,8 @@ func (o *FullApplicationKeyAttributes) HasCreatedAt() bool {
return o != nil && o.CreatedAt != nil
}

// SetCreatedAt gets a reference to the given string and assigns it to the CreatedAt field.
func (o *FullApplicationKeyAttributes) SetCreatedAt(v string) {
// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field.
func (o *FullApplicationKeyAttributes) SetCreatedAt(v time.Time) {
o.CreatedAt = &v
}

Expand Down Expand Up @@ -200,7 +202,11 @@ func (o FullApplicationKeyAttributes) MarshalJSON() ([]byte, error) {
return datadog.Marshal(o.UnparsedObject)
}
if o.CreatedAt != nil {
toSerialize["created_at"] = o.CreatedAt
if o.CreatedAt.Nanosecond() == 0 {
toSerialize["created_at"] = o.CreatedAt.Format("2006-01-02T15:04:05Z07:00")
} else {
toSerialize["created_at"] = o.CreatedAt.Format("2006-01-02T15:04:05.000Z07:00")
}
}
if o.Key != nil {
toSerialize["key"] = o.Key
Expand All @@ -224,7 +230,7 @@ func (o FullApplicationKeyAttributes) MarshalJSON() ([]byte, error) {
// UnmarshalJSON deserializes the given payload.
func (o *FullApplicationKeyAttributes) UnmarshalJSON(bytes []byte) (err error) {
all := struct {
CreatedAt *string `json:"created_at,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"`
Key *string `json:"key,omitempty"`
Last4 *string `json:"last4,omitempty"`
Name *string `json:"name,omitempty"`
Expand Down
37 changes: 36 additions & 1 deletion api/datadogV2/model_user_attributes.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ type UserAttributes struct {
Handle *string `json:"handle,omitempty"`
// URL of the user's icon.
Icon *string `json:"icon,omitempty"`
// If user has MFA enabled.
MfaEnabled *bool `json:"mfa_enabled,omitempty"`
// Time that the user was last modified.
ModifiedAt *time.Time `json:"modified_at,omitempty"`
// Name of the user.
Expand Down Expand Up @@ -196,6 +198,34 @@ func (o *UserAttributes) SetIcon(v string) {
o.Icon = &v
}

// GetMfaEnabled returns the MfaEnabled field value if set, zero value otherwise.
func (o *UserAttributes) GetMfaEnabled() bool {
if o == nil || o.MfaEnabled == nil {
var ret bool
return ret
}
return *o.MfaEnabled
}

// GetMfaEnabledOk returns a tuple with the MfaEnabled field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UserAttributes) GetMfaEnabledOk() (*bool, bool) {
if o == nil || o.MfaEnabled == nil {
return nil, false
}
return o.MfaEnabled, true
}

// HasMfaEnabled returns a boolean if a field has been set.
func (o *UserAttributes) HasMfaEnabled() bool {
return o != nil && o.MfaEnabled != nil
}

// SetMfaEnabled gets a reference to the given bool and assigns it to the MfaEnabled field.
func (o *UserAttributes) SetMfaEnabled(v bool) {
o.MfaEnabled = &v
}

// GetModifiedAt returns the ModifiedAt field value if set, zero value otherwise.
func (o *UserAttributes) GetModifiedAt() time.Time {
if o == nil || o.ModifiedAt == nil {
Expand Down Expand Up @@ -411,6 +441,9 @@ func (o UserAttributes) MarshalJSON() ([]byte, error) {
if o.Icon != nil {
toSerialize["icon"] = o.Icon
}
if o.MfaEnabled != nil {
toSerialize["mfa_enabled"] = o.MfaEnabled
}
if o.ModifiedAt != nil {
if o.ModifiedAt.Nanosecond() == 0 {
toSerialize["modified_at"] = o.ModifiedAt.Format("2006-01-02T15:04:05Z07:00")
Expand Down Expand Up @@ -448,6 +481,7 @@ func (o *UserAttributes) UnmarshalJSON(bytes []byte) (err error) {
Email *string `json:"email,omitempty"`
Handle *string `json:"handle,omitempty"`
Icon *string `json:"icon,omitempty"`
MfaEnabled *bool `json:"mfa_enabled,omitempty"`
ModifiedAt *time.Time `json:"modified_at,omitempty"`
Name datadog.NullableString `json:"name,omitempty"`
ServiceAccount *bool `json:"service_account,omitempty"`
Expand All @@ -460,7 +494,7 @@ func (o *UserAttributes) UnmarshalJSON(bytes []byte) (err error) {
}
additionalProperties := make(map[string]interface{})
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
datadog.DeleteKeys(additionalProperties, &[]string{"created_at", "disabled", "email", "handle", "icon", "modified_at", "name", "service_account", "status", "title", "verified"})
datadog.DeleteKeys(additionalProperties, &[]string{"created_at", "disabled", "email", "handle", "icon", "mfa_enabled", "modified_at", "name", "service_account", "status", "title", "verified"})
} else {
return err
}
Expand All @@ -469,6 +503,7 @@ func (o *UserAttributes) UnmarshalJSON(bytes []byte) (err error) {
o.Email = all.Email
o.Handle = all.Handle
o.Icon = all.Icon
o.MfaEnabled = all.MfaEnabled
o.ModifiedAt = all.ModifiedAt
o.Name = all.Name
o.ServiceAccount = all.ServiceAccount
Expand Down

0 comments on commit ca53a34

Please sign in to comment.