Skip to content

Commit effe580

Browse files
committed
datasource/gitlab_users: Add namespace_id attribute for users
1 parent 6df11ac commit effe580

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

docs/data-sources/users.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ Read-Only:
7474
- `linkedin` (String)
7575
- `location` (String)
7676
- `name` (String)
77+
- `namespace_id` (Number)
7778
- `organization` (String)
7879
- `projects_limit` (Number)
7980
- `provider` (String)

internal/provider/data_source_gitlab_users.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,12 @@ var _ = registerDataSource("gitlab_users", func() *schema.Resource {
212212
Type: schema.TypeString,
213213
Computed: true,
214214
},
215+
"namespace_id": {
216+
Description: "The ID of the user's namespace. Requires admin token to access this field. Available since GitLab 14.10.",
217+
Type: schema.TypeInt,
218+
Optional: true,
219+
Computed: true,
220+
},
215221
},
216222
},
217223
},
@@ -274,6 +280,7 @@ func flattenGitlabUsers(users []*gitlab.User) []interface{} {
274280
"organization": user.Organization,
275281
"theme_id": user.ThemeID,
276282
"color_scheme_id": user.ColorSchemeID,
283+
"namespace_id": user.NamespaceID,
277284
}
278285

279286
if user.CreatedAt != nil {

0 commit comments

Comments
 (0)