Skip to content

Commit

Permalink
Add username output to data_source_opsgenie_team
Browse files Browse the repository at this point in the history
  • Loading branch information
paragor committed Jul 28, 2023
1 parent f2fd65f commit 8c53ba3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions opsgenie/data_source_opsgenie_team.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ func dataSourceOpsGenieTeam() *schema.Resource {
Type: schema.TypeString,
Optional: true,
},
"username": {
Type: schema.TypeString,
Optional: true,
},
"role": {
Type: schema.TypeString,
Optional: true,
Expand Down
7 changes: 6 additions & 1 deletion opsgenie/resource_opsgenie_team.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ func resourceOpsGenieTeam() *schema.Resource {
Type: schema.TypeString,
Required: true,
},

"username": {
Type: schema.TypeString,
Optional: true,
Computed: true,
},
"role": {
Type: schema.TypeString,
Optional: true,
Expand Down Expand Up @@ -202,6 +206,7 @@ func flattenOpsGenieTeamMembers(input []team.Member) []map[string]interface{} {
for _, inputMember := range input {
outputMember := make(map[string]interface{})
outputMember["id"] = inputMember.User.ID
outputMember["username"] = inputMember.User.Username
outputMember["role"] = inputMember.Role
members = append(members, outputMember)
}
Expand Down

0 comments on commit 8c53ba3

Please sign in to comment.