Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GraphClient.Users[id].Sponsors.Ref missing? #2522

Open
stefanboerner opened this issue May 29, 2024 Discussed in #2493 · 2 comments
Open

GraphClient.Users[id].Sponsors.Ref missing? #2522

stefanboerner opened this issue May 29, 2024 Discussed in #2493 · 2 comments
Labels
Bug: metadata type:bug A broken experience

Comments

@stefanboerner
Copy link

Discussed in #2493

Originally posted by stefanboerner May 15, 2024
I'd like to modify the "Sponsors" list of a user as described here but it seems that GraphClient.Users[id].Sponsors.Ref is missing in the microsoft.graph 5.52.0 library. Will this be added in an upcoming version?

@andrueastman
Copy link
Member

Thanks for raising this @stefanboerner

We'll close this once microsoftgraph/msgraph-metadata#634 is resolved as this looks to be caused by a missing path in the input metadata.

@andrueastman
Copy link
Member

This can possibly be worked around as below in the meantime

            var requestInformation = new RequestInformation
            {
                HttpMethod = Method.POST,
                URI = new Uri("https://graph.microsoft.com/v1.0/users/d8ab5060-f636-4cff-ae97-d4687f5c83f3/sponsors/$ref")
            };
            var propeties = new Dictionary<string, UntypedNode> 
            {
                { "@odata.id", new UntypedString("https://graph.microsoft.com/v1.0/users/{user-id}") }
            };
            var content = new UntypedObject(propeties);
            requestInformation.SetContentFromParsable(graphClient.RequestAdapter,"application/json", content);

            // send the request
            await graphClient.RequestAdapter.SendNoContentAsync(requestInformation,new Dictionary<string, ParsableFactory<IParsable>>());

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug: metadata type:bug A broken experience
Projects
None yet
Development

No branches or pull requests

2 participants