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

Can't set SkuID to add a license to a user #735

Closed
Trevor-J-Ortiz opened this issue Jun 21, 2024 · 4 comments
Closed

Can't set SkuID to add a license to a user #735

Trevor-J-Ortiz opened this issue Jun 21, 2024 · 4 comments
Labels
Status no recent activity status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close type:question An issue that's a question

Comments

@Trevor-J-Ortiz
Copy link

On the assign license doc, it requires setting the SkuID using the uuid package. UUID is internal so it can't be imported. Is there another way to set the SkuID or am I doing this incorrectly?

https://github.com/microsoftgraph/msgraph-sdk-go/blob/v1.45.0/models/assigned_license.go
https://learn.microsoft.com/en-us/graph/api/user-assignlicense?view=graph-rest-1.0&tabs=go
image

@andrueastman
Copy link
Member

Thanks for raising this @Trevor-J-Ortiz

Any chance you can confirm if the GO sample at the link below is helpful? https://learn.microsoft.com/en-us/graph/api/user-assignlicense?view=graph-rest-1.0&tabs=go

@andrueastman andrueastman added status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close type:question An issue that's a question labels Jun 25, 2024
@Trevor-J-Ortiz
Copy link
Author

@andrueastman I did review this and that's where I ran into the issue. It shows the following code that leverages uuid.UUID which is an internal package. This is preventing me from using uuid.MustParse(), even if I got around the uuid by copying the uuid package code, .SetSkuId requires a *uuid.UUID parameter (as I screenshotted above). Below is a copy of the code I'm having issue with from the learn docs.

skuId := uuid.MustParse("45715bb8-13f9-4bf6-927f-ef96c102d394")
assignedLicense.SetSkuId(&skuId)

addLicenses := []graphmodels.AssignedLicenseable {
assignedLicense,
}

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs Attention 👋 and removed status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close labels Jun 25, 2024
@andrueastman
Copy link
Member

@Trevor-J-Ortiz

I believe you only need to add the import for "github.com/google/uuid" as the generated code relies on the package for the type.

Any chance you can confirm this works out for you?

@andrueastman andrueastman added status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close and removed Needs Attention 👋 labels Jun 26, 2024
Copy link
Contributor

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status no recent activity status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close type:question An issue that's a question
Projects
None yet
Development

No branches or pull requests

2 participants