Skip to content

Commit

Permalink
Reformat dates in RFC3339 format
Browse files Browse the repository at this point in the history
  • Loading branch information
ecdatadog committed Jan 21, 2025
1 parent 814fb7c commit e3e574a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
9 changes: 5 additions & 4 deletions datadog/data_source_datadog_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package datadog

import (
"context"
"time"

"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
Expand Down Expand Up @@ -30,7 +31,7 @@ func dataSourceDatadogUser() *schema.Resource {
},
// Computed values
"created_at": {
Description: "Creation time of the user.",
Description: "Creation time of the user (RFC3339 format).",
Type: schema.TypeString,
Computed: true,
},
Expand Down Expand Up @@ -60,7 +61,7 @@ func dataSourceDatadogUser() *schema.Resource {
Computed: true,
},
"modified_at": {
Description: "Time that the user was last modified.",
Description: "Time that the user was last modified (RFC3339 format).",
Type: schema.TypeString,
Computed: true,
},
Expand Down Expand Up @@ -148,11 +149,11 @@ func dataSourceDatadogUserRead(ctx context.Context, d *schema.ResourceData, meta
}
d.SetId(matchedUser.GetId())
mapAttrString := map[string]func() string{
"created_at": func() string { return matchedUser.Attributes.GetCreatedAt().String() },
"created_at": func() string { return matchedUser.Attributes.GetCreatedAt().Format(time.RFC3339) },
"email": matchedUser.Attributes.GetEmail,
"handle": matchedUser.Attributes.GetHandle,
"icon": matchedUser.Attributes.GetIcon,
"modified_at": func() string { return matchedUser.Attributes.GetModifiedAt().String() },
"modified_at": func() string { return matchedUser.Attributes.GetModifiedAt().Format(time.RFC3339) },
"name": matchedUser.Attributes.GetName,
"status": matchedUser.Attributes.GetStatus,
"title": matchedUser.Attributes.GetTitle,
Expand Down
4 changes: 2 additions & 2 deletions docs/data-sources/user.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ data "datadog_user" "test" {

### Read-Only

- `created_at` (String) Creation time of the user.
- `created_at` (String) Creation time of the user (RFC3339 format).
- `disabled` (Boolean) Whether the user is disabled.
- `email` (String) Email of the user.
- `handle` (String) Handle of the user.
- `icon` (String) URL of the user's icon.
- `id` (String) The ID of this resource.
- `mfa_enabled` (Boolean) If user has MFA enabled.
- `modified_at` (String) Time that the user was last modified.
- `modified_at` (String) Time that the user was last modified (RFC3339 format).
- `name` (String) Name of the user.
- `service_account` (Boolean) Whether the user is a service account.
- `status` (String) Status of the user.
Expand Down

0 comments on commit e3e574a

Please sign in to comment.