Skip to content

Commit f16610d

Browse files
committed
clean up table of contents
1 parent 5a74549 commit f16610d

File tree

1 file changed

+40
-11
lines changed

1 file changed

+40
-11
lines changed

docs/upgrade-to-v6.md

Lines changed: 40 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,41 @@
1-
# Microsoft Graph Java SDK v6 Changelog and Upgrade Guide
1+
# Microsoft Graph Java SDK v6 Changelog and Upgrade Guide
22

33
This document provides a list of changes and upgrade considerations for the Microsoft Graph Java SDK v6 release.
44

5-
## Overview
5+
## Overview
66

77
Version 6.0.0 of the Microsoft Graph Java SDK is based on the new [Kiota](https://github.com/microsoft/kiota) code generation tool. By using Kiota the SDK is now able to support a broader range of Microsoft Graph API enpoints while also being more intuitive. Furthermore, [Graph-Core](https://github.com/microsoftgraph/msgraph-sdk-java-core) has also been updated to v3 which provides a great amount of added functionality; this makes v6 of the SDK a significant upgrade from v5.
88

9+
## Table Of Contents
10+
11+
- [Breaking Changes](#breaking-changes)
12+
- [Namespace Changes and Disambiguation](#namespace-changes-and-disambiguation)
13+
- [Authentication](#authentication)
14+
- [`BaseRequest<T>` Changed to `RequestInformation`](#use-of-requestinformation-in-place-of-baserequestt)
15+
- [Removal of `Async` Suffix](#removal-of-async-suffix-from-executor-methods)
16+
- [Removal of `buildRequest`](#removal-of-buildrequest)
17+
- [`CollectionPage` Changed to `CollectionResponse`](#collectionpage-types-changed-to-collectionresponse-types)
18+
- [Private Properties](#properties-now-accessed-via-getters-and-setters)
19+
- [Querying Collections](#querying-collections)
20+
- [Indexing via Improved Fluent API Pattern](#change-in-indexing-via-improved-fluent-api-pattern)
21+
- [Option Class Removal](#option-class-removal)
22+
- [Header Options](#headers)
23+
- [Query Parameter Options](#query-parameter-options)
24+
- [Odata Function Parameters](#odata-function-parameters)
25+
- [Odata Action Parameters](#odata-action-parameters)
26+
- [Error Handling](#error-handling)
27+
- [Drive Item Paths](#drive-item-paths)
28+
- [Upload a Small File with conflictBehavior Set](#upload-a-small-file-with-conflictbehavior-set)
29+
- [New Features](#new-features)
30+
- [Backing Store](#backing-store)
31+
- [Page Iterator](#pageiterator)
32+
- [Batch Requests](#batch-requests)
33+
- [Large File Upload Enhancements](#large-file-upload-enhancements)
34+
- [Per-Request Options](#per-request-options)
35+
- [Native Response Object](#native-response-object)
36+
- [Support for OData Casts](#support-for-odata-casts)
37+
38+
939
## Breaking Changes
1040

1141
The following is a list of breaking changes that users upgrading will want to consider while upgrading to v6 of the SDK.
@@ -20,7 +50,7 @@ This has the following implications:
2050
- Models types are now stored in `com.microsoft.graph.models`/`com.microsoft.graph.beta.models` for v1.0 and beta respectively.
2151
- RequestBuilder and RequestBody types reside in namespaces relative to the path they are calling. e.g. The `SendMailRequestBuilder` and `SendMailPostRequestBody` types will reside in the `com.microsoft.graph.users.item.sendmail`/`com.microsoft.graph.beta.users.item.sendMail` namespace if you are sending mail via `graphClient.me().sendMail().post(sendMailPostRequestBody)`.
2252

23-
### Authentication
53+
### Authentication
2454

2555
The `GraphServiceClient` class now accepts an instance of `TokenCredential` from AzureIdentity directly rather than an instance of `TokenCredentialAuthProvider`.
2656
Thus
@@ -85,7 +115,7 @@ graphClient.directoryObjects().toPostRequestInformation(directoryObject);
85115
The sdk no longer provides async methods for executing requests thus the async suffix has removed from executor methods. `postAsync()` is removed and now only `post()` is available, `getAsync()` is removed and only `get()`is available, etc.
86116
> If users wish to execute requests asynchronusly they may choose to wrap their calls in CompleteableFutures or a separate async workflow.
87117

88-
### Removal of `buildRequest()`
118+
### Removal of `buildRequest()`
89119

90120
In the previous version of the SDK the `buildRequest()` method call was neccessary when building and calling requests.
91121
Previously a call to get the current user would look like the following:
@@ -109,7 +139,7 @@ In v6 the same call would return:
109139
UserCollectionResponse users = graphClient.users().get();
110140
```
111141

112-
## Properties Now Accessed via Getters and Setters
142+
### Properties Now Accessed via Getters and Setters
113143

114144
In v5 properties were accessed directly via the property name. In v6 properties are accessed via getters and setters.
115145
For example, in v5 a user would access the `displayName` property of a `User` object as follows:
@@ -139,7 +169,7 @@ UserCollectionResponse response = graphClient.users().get();
139169
List<User> usersList = response.getValue();
140170
```
141171

142-
### Change in Indexing via Improved Fluent API Pattern
172+
### Change in Indexing via Improved Fluent API Pattern
143173

144174
The fluent API pattern has changed slightly in v6. Previously the fluent API pattern would index into a collection through an overload method call in the request builder pattern. In v6 we have added the `byId` suffix to make it obvious when a user is indexing into a collection.
145175
For example, retrieving a message by id would look like the following in v5:
@@ -155,7 +185,7 @@ Message singleMessage = graphClient.me().messages().byMessageId("<Message Id>").
155185

156186
The `Option` class has been removed and is no longer used to define query parameters, headers, or function parameters. These classes have been replaced with more specific and intuitive implementations.
157187

158-
#### Headers
188+
#### Headers
159189
Passing headers to requests has changed in v6. The `HeaderOption` class, which extends the `Option` class, has been removed and is no longer used to define headers.
160190
Previously a user would pass headers to a request as follows:
161191
```java
@@ -227,7 +257,7 @@ sendMailPostRequestBody.setSaveToSentItems(true);
227257
graphClient.me().sendMail().post(sendMailPostRequestBody);
228258
```
229259

230-
### Error Handling
260+
### Error Handling
231261

232262
`GraphServiceException` has been removed and is no longer used to handle errors. Instead, the SDK now throws an `ApiException` when an issue occurs with a request. The message of the `ApiException` will contain a more specific error message based on the OdataError returned from the API. `ClientException` remains, however, this is now used to handle less frequent issues with the client itself.
233263
In v6 a user would handle an error as follows:
@@ -285,7 +315,7 @@ DriveItemCollectionResponse response = graphClient.drives().byDriveId(groupDrive
285315
// See note above for using 'root' as the 'Item Id'
286316
```
287317

288-
#### Upload a Small File with conflictBehavior Set
318+
### Upload a Small File with conflictBehavior Set
289319

290320
To upload a small file (size should not exceed 4mb according to the [docs](https://learn.microsoft.com/en-us/graph/api/driveitem-put-content?view=graph-rest-1.0&tabs=http)) and set the `conflictBehavior` [instance attribute](https://learn.microsoft.com/en-us/graph/api/resources/driveitem?view=graph-rest-1.0#instance-attributes) you'll need to do it this way:
291321

@@ -350,7 +380,7 @@ PageIterator<Message, MessageCollectionResponse> pageIterator = new PageIterator
350380
pageIterator.iterate();
351381
```
352382

353-
### Batch Requests
383+
### Batch Requests
354384

355385
The Java SDK now supports Batch requests. Batching allows a user to send multiple requests in a single HTTP request which can improve performance and reduce network traffic. A user can chose to add a `RequestInformation` instance or an OkHttp3 `Request` instance to the Batch which will then be sent to the API as a single HTTP request. See here for more information on [batching](https://learn.microsoft.com/en-us/graph/json-batching).
356386
```java
@@ -446,7 +476,6 @@ try{
446476
// If your application encounters a connection interruption or a 5.x.x HTTP status during upload, you can resume the upload.
447477
// Handle logic
448478
uploadTask.resume();
449-
450479
```
451480

452481
### Per-Request Options

0 commit comments

Comments
 (0)