@@ -316,12 +316,18 @@ func convertResponseToTeamMember(response client.TeamMember, plan TeamMember) Te
316
316
))
317
317
}
318
318
projects := types .SetValueMust (projectsElemType , projectsAttrs )
319
+ if len (projectsAttrs ) == 0 {
320
+ projects = types .SetNull (projectsElemType )
321
+ }
319
322
320
323
var ags []attr.Value
321
324
for _ , ag := range response .AccessGroups {
322
325
ags = append (ags , types .StringValue (ag .ID ))
323
326
}
324
327
accessGroups := types .SetValueMust (types .StringType , ags )
328
+ if len (ags ) == 0 {
329
+ accessGroups = types .SetNull (types .StringType )
330
+ }
325
331
326
332
teamMember := TeamMember {
327
333
UserID : types .StringValue (response .UserID ),
@@ -448,10 +454,11 @@ func (r *teamMemberResource) Read(ctx context.Context, req resource.ReadRequest,
448
454
TeamID : state .TeamID .ValueString (),
449
455
UserID : state .UserID .ValueString (),
450
456
})
451
- tflog .Error (ctx , "Read team member" , map [string ]any {
452
- "team_id" : state .TeamID .ValueString (),
453
- "user_id" : state .UserID .ValueString (),
454
- "err" : err ,
457
+ tflog .Info (ctx , "Read team member" , map [string ]any {
458
+ "team_id" : state .TeamID .ValueString (),
459
+ "user_id" : state .UserID .ValueString (),
460
+ "err" : err ,
461
+ "response" : response ,
455
462
})
456
463
if client .NotFound (err ) {
457
464
resp .State .RemoveResource (ctx )
0 commit comments