Skip to content

Commit 76dbb87

Browse files
Ramon Rüttimanntimofurrer
authored andcommitted
Enforce one of group id or full path in data source group membership
`ExactlyOneOf` enforces that one of `group_id` or `full_path` must be set, which is more correct than the previous `ConflictsWith` setting.
1 parent 0e44a4a commit 76dbb87

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

internal/provider/data_source_gitlab_group_membership.go

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,18 @@ var _ = registerDataSource("gitlab_group_membership", func() *schema.Resource {
2222
ReadContext: dataSourceGitlabGroupMembershipRead,
2323
Schema: map[string]*schema.Schema{
2424
"group_id": {
25-
Description: "The ID of the group.",
26-
Type: schema.TypeInt,
27-
Computed: true,
28-
Optional: true,
29-
ConflictsWith: []string{
30-
"full_path",
31-
},
25+
Description: "The ID of the group.",
26+
Type: schema.TypeInt,
27+
Computed: true,
28+
Optional: true,
29+
ExactlyOneOf: []string{"group_id", "full_path"},
3230
},
3331
"full_path": {
34-
Description: "The full path of the group.",
35-
Type: schema.TypeString,
36-
Computed: true,
37-
Optional: true,
38-
ConflictsWith: []string{
39-
"group_id",
40-
},
32+
Description: "The full path of the group.",
33+
Type: schema.TypeString,
34+
Computed: true,
35+
Optional: true,
36+
ExactlyOneOf: []string{"group_id", "full_path"},
4137
},
4238
"access_level": {
4339
Description: "Only return members with the desired access level. Acceptable values are: `guest`, `reporter`, `developer`, `maintainer`, `owner`.",

0 commit comments

Comments
 (0)