Undefined types in Golang for users related to Delta parameters and configurations #768
Labels
Status no recent activity
status:waiting-for-author-feedback
Issue that we've responded but needs author feedback to close
type:bug
A broken experience
Describe the bug
With an app-only authentication program I am attempting to monitor particular user's mail folder utilizing delta requests. The requests work in Graph Explorer. When utilizing the code snippet built by Explorer for the query an undefined returned for both the Parameters and the Configuration.
The two types in question are users.UserItemMailFolderItemMessagesDeltaWithRequestBuilderGetQueryParameters and users.UserItemMailFolderItemMessagesDeltaWithRequestBuilderGetRequestConfiguration.
Here is an example of the query used in Explorer:
https://graph.microsoft.com/v1.0/users/{id}/mailFolders('inbox')/messages/delta?changeType=created&$select=subject,from,isRead,body,receivedDateTime
The code snippet generated is as follows:
import (
"context"
abstractions "github.com/microsoft/kiota-abstractions-go"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphusers "github.com/microsoftgraph/msgraph-sdk-go/users"
//other-imports
)
headers := abstractions.NewRequestHeaders()
headers.Add("Prefer", "outlook.body-content-type="text"")
requestChangeType := "created"
requestParameters := &graphusers.UserItemMailFolderItemMessagesDeltaWithRequestBuilderGetQueryParameters{
ChangeType: &requestChangeType,
Select: [] string {"subject","from","isRead","body","receivedDateTime"},
}
configuration := &graphusers.UserItemMailFolderItemMessagesDeltaWithRequestBuilderGetRequestConfiguration{
Headers: headers,
QueryParameters: requestParameters,
}
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
delta, err := graphClient.Users().ByUserId("user-id").MailFolders().ByMailFolderId("mailFolder-id").Messages().Delta().GetAsDeltaGetResponse(context.Background(), configuration)
Expected behavior
I expected the sample code generated by Graph Explorer to compile
How to reproduce
Place the provided query in Explorer and execute. Review the Golang code snippet and open with vscode. That will immediately highlight the two types as undefined.
SDK Version
1.47.0
Latest version known to work for scenario above?
No response
Known Workarounds
No response
Debug output
undefined: users.UserItemMailFolderItemMessagesDeltaWithRequestBuilderGetRequestConfigurationcompilerUndeclaredIm
(undefined: users.UserItemMailFolderItemMessagesDeltaWithRequestBuilderGetQueryParameterscompilerUndeclaredImporte
Configuration
macOS 14.6.1
Apple M3 Pro
Other information
No response
The text was updated successfully, but these errors were encountered: