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

Missing request types in the upgraded version #1856

Closed
varunrathi1910 opened this issue Feb 27, 2024 · 4 comments
Closed

Missing request types in the upgraded version #1856

varunrathi1910 opened this issue Feb 27, 2024 · 4 comments

Comments

@varunrathi1910
Copy link

After upgrading to version 6, certain request types appear to be missing. These include:

"https://graph.microsoft.com/v1.0/sites/{site-id}/sites/{subsite-id}/lists/{list-id}/items/{item-id}" - Retrieving an item from a subsite.
"https://graph.microsoft.com/v1.0/sites/{site-id}/sites/{subsite-id}/lists/{list-id}/drive" - Retrieving details of a drive.
"https://graph.microsoft.com/v1.0/users/{user_id}/messages/{id}/attachments/{id}/$value)" - Fetching attachment content.
"https://graph.microsoft.com/v1.0/appCatalogs/teamsApps" - Publishing a Teams Application via the POST method.

Previously, we used the following requests for these actions:
graphServiceClient.sites("site-id").sites("web-id").lists("list-id").items("item-id").get();
graphServiceClient.sites("site-id").sites("web-id").lists("list-id").drive().get();
FileAttachmentRequestBuilder attachmentRequestBuilder = new FileAttachmentRequestBuilder("https://graph.microsoft.com/v1.0/users/{user_id}/messages/{id}/attachments/{id}", graphServiceClient, null); return attachmentRequestBuilder.content().buildRequest().get();

Along with the upgrade guide, we have referred to the following links for guidance:

https://learn.microsoft.com/en-us/graph/api/attachment-get?view=graph-rest-1.0&tabs=http#http-request
https://learn.microsoft.com/en-us/graph/api/teamsapp-publish?view=graph-rest-1.0&tabs=http#http-request

Are there any alternatives available to execute these requests in upgraded version, or do we need to execute them manually?

Furthermore, would it be advisable for us to transition to v6 in our production environment, or should we wait for further stabilization of the version?

@baywet
Copy link
Member

baywet commented Feb 27, 2024

Hi @varunrathi1910
Thanks for using the Java SDK.

List/drive operations on subsites:
To avoid the SDK becoming too large (it supports many more operations the previous one did) we limited the generation to the canonical paths. Because a subsite is still a site, we're not repeating the drives/lists segments under it.
You can either:

  • pass the complete id of the subsite instead of the site it, and use that API path instead
  • use the withUrl method on the request builder to build the correct target url yourself but still use the fluent API.

app catelogs post is present :

public TeamsApp post(@jakarta.annotation.Nonnull final TeamsApp body) {

Message attachment: this is a limitation of how the service documents its metadata unfortunately that doesn't allow us to generate the right code path.
You can use any of the content request builders for the time being and build the URI yourself as a workaround https://github.com/microsoftgraph/msgraph-sdk-java/blob/dev/src/main/java/com/microsoft/graph/generated/teams/item/photo/value/ContentRequestBuilder.java

This version is stable besides the few edge cases due to the change of generation technology and is ready for production. We encourage customers to migrate to it.

Let us know if you have further questions.

@varunrathi1910
Copy link
Author

Hi @baywet ,
Thank you for suggesting the above alternatives. I also wanted to know if there is a way to utilize the PageIterator class to iterate over a result set of Strings . When attempting to use the iterator, an error is displayed indicating that String does not extend Parsable and therefore the iterator cannot be utilized. We are currently iterating it manually.

I am attempting to iterate over the following endpoint:
mGraphServiceClient.users().byUserId("user-id").checkMemberObjects()

The compilation error received is:

Bound mismatch: The type String is not a valid substitute for the bounded parameter of the type PageIterator.Builder<TEntity,TCollectionPage>.

@baywet
Copy link
Member

baywet commented Feb 29, 2024

Currently it's not possible. However with the work ongoing here it might be in the future.

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
Projects
None yet
Development

No branches or pull requests

2 participants