@@ -159,12 +159,13 @@ func resourceGithubTeamSettingsUpdate(d *schema.ResourceData, meta any) error {
159159 } `graphql:"updateTeamReviewAssignment(input:$input)"`
160160 }
161161
162- return graphql .Mutate (ctx , & mutation , UpdateTeamReviewAssignmentInput {
163- TeamID : d .Id (),
164- ReviewRequestDelegation : true ,
165- ReviewRequestDelegationAlgorithm : settings ["algorithm" ].(string ),
166- ReviewRequestDelegationCount : settings ["member_count" ].(int ),
167- ReviewRequestDelegationNotifyAll : settings ["notify" ].(bool ),
162+ teamReviewAlgorithm := githubv4 .TeamReviewAssignmentAlgorithm (settings ["algorithm" ].(string ))
163+ return graphql .Mutate (ctx , & mutation , githubv4.UpdateTeamReviewAssignmentInput {
164+ ID : d .Id (),
165+ Enabled : githubv4 .Boolean (true ),
166+ Algorithm : & teamReviewAlgorithm ,
167+ TeamMemberCount : githubv4 .NewInt (githubv4 .Int (settings ["member_count" ].(int ))),
168+ NotifyTeam : githubv4 .NewBoolean (githubv4 .Boolean (settings ["notify" ].(bool ))),
168169 }, nil )
169170 }
170171 }
@@ -233,22 +234,14 @@ func resolveTeamIDs(idOrSlug string, meta *Owner, ctx context.Context) (nodeId,
233234 }
234235}
235236
236- type UpdateTeamReviewAssignmentInput struct {
237- ClientMutationID string `json:"clientMutationId,omitempty"`
238- TeamID string `graphql:"id" json:"id"`
239- ReviewRequestDelegation bool `graphql:"enabled" json:"enabled"`
240- ReviewRequestDelegationAlgorithm string `graphql:"algorithm" json:"algorithm"`
241- ReviewRequestDelegationCount int `graphql:"teamMemberCount" json:"teamMemberCount"`
242- ReviewRequestDelegationNotifyAll bool `graphql:"notifyTeam" json:"notifyTeam"`
243- }
244-
245- func defaultTeamReviewAssignmentSettings (id string ) UpdateTeamReviewAssignmentInput {
246- return UpdateTeamReviewAssignmentInput {
247- TeamID : id ,
248- ReviewRequestDelegation : false ,
249- ReviewRequestDelegationAlgorithm : "ROUND_ROBIN" ,
250- ReviewRequestDelegationCount : 1 ,
251- ReviewRequestDelegationNotifyAll : true ,
237+ func defaultTeamReviewAssignmentSettings (id string ) githubv4.UpdateTeamReviewAssignmentInput {
238+ roundRobinAlgo := githubv4 .TeamReviewAssignmentAlgorithmRoundRobin
239+ return githubv4.UpdateTeamReviewAssignmentInput {
240+ ID : id ,
241+ Enabled : githubv4 .Boolean (false ),
242+ Algorithm : & roundRobinAlgo ,
243+ TeamMemberCount : githubv4 .NewInt (githubv4 .Int (1 )),
244+ NotifyTeam : githubv4 .NewBoolean (true ),
252245 }
253246}
254247
0 commit comments