microsoftgraph / msgraph-sdk-go

Microsoft Graph SDK for Go
https://docs.microsoft.com/en-us/graph/sdks/sdks-overview
MIT License
214 stars 32 forks source link

Missing GetIsArchived() result on Teamable entity #727

Closed buechele closed 4 weeks ago

buechele commented 1 month ago

I want to check if a team is archived but the Teamable entity delivers nil in every case.

rkodev commented 4 weeks ago

Hi @buechele could you share a snippet of the code you are executing

buechele commented 4 weeks ago

Hi @rkodev this is the code I used on a tanent with around 100 teams:

graphClient, _ := graph.NewGraphServiceClientWithCredentials(
        cred, []string{"https://graph.microsoft.com/.default"})

teams := getTeamIds(graphClient, nil)
for _, team := range teams {
    isArchived := team.GetIsArchived()
    if isArchived == nil {
        fmt.Println("is nil")
    }
}

It gives nil in each case. The same behavior applies for GetCreatedDateTime().

rkodev commented 4 weeks ago

kindly share the sdk call you make in the function getTeamIds(graphClient, nil)

buechele commented 4 weeks ago

@rkodev Ups... sorry!!! Now with no internal calls:

graphClient, _ := graph.NewGraphServiceClientWithCredentials(
        cred, []string{"https://graph.microsoft.com/.default"})

response, _ := graphClient.Teams().Get(context.Background(), nil)
teams := response.GetValue()
for _, team := range teams {
    isArchived := team.GetIsArchived()
    if isArchived == nil {
        fmt.Println("is nil")
    }
}
buechele commented 4 weeks ago

I've just seen this in the documentation:

This API has a known issue where it returns only the id, displayName, and description properties of a team.To get all properties, use the Get team operation.

https://developer.microsoft.com/en-us/graph/known-issues/?search=13633

Is there any fix in preparation for this in the near future?

rkodev commented 4 weeks ago

@buechele As noted this is an service layer issue and not an issue with the SDK and I can't give you an estimate at the moment. You will need to use the Get Team operation for now until the issue is resolved.

buechele commented 4 weeks ago

@rkodev Ok, many thanks for this clarification!