Skip to content
This repository was archived by the owner on Sep 4, 2020. It is now read-only.

Commit 582b268

Browse files
author
Caitlin Bales (MSFT)
committed
Overwrite generated OneNote post requests
OneNote uses a non-OData compliant structure to post OneNote pages as a stream instead of a OnenotePage object.
1 parent b3acf8d commit 582b268

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

graphsdk/src/main/java/com/microsoft/graph/generated/BaseOnenotePageCollectionRequest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,18 +53,18 @@ public IOnenotePageCollectionPage get() throws ClientException {
5353
return buildFromResponse(response);
5454
}
5555

56-
public void post(final OnenotePage newOnenotePage, final ICallback<OnenotePage> callback) {
56+
public void post(final byte[] newOnenotePage, final ICallback<OnenotePage> callback) {
5757
final String requestUrl = getBaseRequest().getRequestUrl().toString();
5858
new OnenotePageRequestBuilder(requestUrl, getBaseRequest().getClient(), /* Options */ null)
59-
.buildRequest()
60-
.post(newOnenotePage, callback);
59+
.buildRequest(getBaseRequest().getOptions())
60+
.post(newOnenotePage, callback);
6161
}
6262

63-
public OnenotePage post(final OnenotePage newOnenotePage) throws ClientException {
63+
public OnenotePage post(final byte[] newOnenotePage) throws ClientException {
6464
final String requestUrl = getBaseRequest().getRequestUrl().toString();
6565
return new OnenotePageRequestBuilder(requestUrl, getBaseRequest().getClient(), /* Options */ null)
66-
.buildRequest()
67-
.post(newOnenotePage);
66+
.buildRequest(getBaseRequest().getOptions())
67+
.post(newOnenotePage);
6868
}
6969

7070
/**

graphsdk/src/main/java/com/microsoft/graph/generated/BaseOnenotePageRequest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public OnenotePage patch(final OnenotePage sourceOnenotePage) throws ClientExcep
9494
* @param newOnenotePage The new object to create
9595
* @param callback The callback to be called after success or failure.
9696
*/
97-
public void post(final OnenotePage newOnenotePage, final ICallback<OnenotePage> callback) {
97+
public void post(final byte[] newOnenotePage, final ICallback<OnenotePage> callback) {
9898
send(HttpMethod.POST, callback, newOnenotePage);
9999
}
100100

@@ -104,7 +104,7 @@ public void post(final OnenotePage newOnenotePage, final ICallback<OnenotePage>
104104
* @return The created OnenotePage
105105
* @throws ClientException This exception occurs if the request was unable to complete for any reason.
106106
*/
107-
public OnenotePage post(final OnenotePage newOnenotePage) throws ClientException {
107+
public OnenotePage post(final byte[] newOnenotePage) throws ClientException {
108108
return send(HttpMethod.POST, newOnenotePage);
109109
}
110110

graphsdk/src/main/java/com/microsoft/graph/generated/IBaseOnenotePageCollectionRequest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ public interface IBaseOnenotePageCollectionRequest {
2626

2727
IOnenotePageCollectionPage get() throws ClientException;
2828

29-
void post(final OnenotePage newOnenotePage, final ICallback<OnenotePage> callback);
29+
void post(final byte[] newOnenotePage, final ICallback<OnenotePage> callback);
3030

31-
OnenotePage post(final OnenotePage newOnenotePage) throws ClientException;
31+
OnenotePage post(final byte[] newOnenotePage) throws ClientException;
3232

3333
/**
3434
* Sets the expand clause for the request

graphsdk/src/main/java/com/microsoft/graph/generated/IBaseOnenotePageRequest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,15 @@ public interface IBaseOnenotePageRequest extends IHttpRequest {
6767
* @param newOnenotePage The new object to create
6868
* @param callback The callback to be called after success or failure.
6969
*/
70-
void post(final OnenotePage newOnenotePage, final ICallback<OnenotePage> callback);
70+
void post(final byte[] newOnenotePage, final ICallback<OnenotePage> callback);
7171

7272
/**
7373
* Posts a OnenotePage with a new object
7474
* @param newOnenotePage The new object to create
7575
* @return The created OnenotePage
7676
* @throws ClientException This exception occurs if the request was unable to complete for any reason.
7777
*/
78-
OnenotePage post(final OnenotePage newOnenotePage) throws ClientException;
78+
OnenotePage post(final byte[] newOnenotePage) throws ClientException;
7979

8080
/**
8181
* Sets the select clause for the request

0 commit comments

Comments
 (0)