@@ -177,12 +177,13 @@ func resourceGithubTeamSettingsUpdate(d *schema.ResourceData, meta any) error {
177177 } `graphql:"updateTeamReviewAssignment(input:$input)"`
178178 }
179179
180- return graphql .Mutate (ctx , & mutation , UpdateTeamReviewAssignmentInput {
181- TeamID : d .Id (),
182- ReviewRequestDelegation : true ,
183- ReviewRequestDelegationAlgorithm : settings ["algorithm" ].(string ),
184- ReviewRequestDelegationCount : settings ["member_count" ].(int ),
185- ReviewRequestDelegationNotifyAll : settings ["notify" ].(bool ),
180+ teamReviewAlgorithm := githubv4 .TeamReviewAssignmentAlgorithm (settings ["algorithm" ].(string ))
181+ return graphql .Mutate (ctx , & mutation , githubv4.UpdateTeamReviewAssignmentInput {
182+ ID : d .Id (),
183+ Enabled : githubv4 .Boolean (true ),
184+ Algorithm : & teamReviewAlgorithm ,
185+ TeamMemberCount : githubv4 .NewInt (githubv4 .Int (settings ["member_count" ].(int ))),
186+ NotifyTeam : githubv4 .NewBoolean (githubv4 .Boolean (settings ["notify" ].(bool ))),
186187 }, nil )
187188 }
188189 }
@@ -251,22 +252,14 @@ func resolveTeamIDs(idOrSlug string, meta *Owner, ctx context.Context) (nodeId,
251252 }
252253}
253254
254- type UpdateTeamReviewAssignmentInput struct {
255- ClientMutationID string `json:"clientMutationId,omitempty"`
256- TeamID string `graphql:"id" json:"id"`
257- ReviewRequestDelegation bool `graphql:"enabled" json:"enabled"`
258- ReviewRequestDelegationAlgorithm string `graphql:"algorithm" json:"algorithm"`
259- ReviewRequestDelegationCount int `graphql:"teamMemberCount" json:"teamMemberCount"`
260- ReviewRequestDelegationNotifyAll bool `graphql:"notifyTeam" json:"notifyTeam"`
261- }
262-
263- func defaultTeamReviewAssignmentSettings (id string ) UpdateTeamReviewAssignmentInput {
264- return UpdateTeamReviewAssignmentInput {
265- TeamID : id ,
266- ReviewRequestDelegation : false ,
267- ReviewRequestDelegationAlgorithm : "ROUND_ROBIN" ,
268- ReviewRequestDelegationCount : 1 ,
269- ReviewRequestDelegationNotifyAll : true ,
255+ func defaultTeamReviewAssignmentSettings (id string ) githubv4.UpdateTeamReviewAssignmentInput {
256+ roundRobinAlgo := githubv4 .TeamReviewAssignmentAlgorithmRoundRobin
257+ return githubv4.UpdateTeamReviewAssignmentInput {
258+ ID : id ,
259+ Enabled : githubv4 .Boolean (false ),
260+ Algorithm : & roundRobinAlgo ,
261+ TeamMemberCount : githubv4 .NewInt (githubv4 .Int (1 )),
262+ NotifyTeam : githubv4 .NewBoolean (true ),
270263 }
271264}
272265
0 commit comments