Skip to content

Commit 6e7acc8

Browse files
authored
Merge pull request #463 from microsoftgraph/feature/get-request
Feature/get request
2 parents cc6e1df + ab08809 commit 6e7acc8

File tree

953 files changed

+2467
-1104
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

953 files changed

+2467
-1104
lines changed

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"java.configuration.updateBuildConfiguration": "interactive"
2+
"java.configuration.updateBuildConfiguration": "automatic"
33
}

src/main/java/com/microsoft/graph/callrecords/requests/extensions/ICallRecordCollectionRequest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,14 @@
1313
import java.util.EnumSet;
1414

1515
import com.microsoft.graph.http.IBaseCollectionPage;
16+
import com.microsoft.graph.http.IHttpRequest;
1617

1718
// **NOTE** This file was generated by a tool and any changes will be overwritten.
1819

1920
/**
2021
* The interface for the Call Record Collection Request.
2122
*/
22-
public interface ICallRecordCollectionRequest {
23+
public interface ICallRecordCollectionRequest extends IHttpRequest {
2324

2425
void get(final ICallback<ICallRecordCollectionPage> callback);
2526

src/main/java/com/microsoft/graph/callrecords/requests/extensions/ISegmentCollectionRequest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,14 @@
1313
import java.util.EnumSet;
1414

1515
import com.microsoft.graph.http.IBaseCollectionPage;
16+
import com.microsoft.graph.http.IHttpRequest;
1617

1718
// **NOTE** This file was generated by a tool and any changes will be overwritten.
1819

1920
/**
2021
* The interface for the Segment Collection Request.
2122
*/
22-
public interface ISegmentCollectionRequest {
23+
public interface ISegmentCollectionRequest extends IHttpRequest {
2324

2425
void get(final ICallback<ISegmentCollectionPage> callback);
2526

src/main/java/com/microsoft/graph/callrecords/requests/extensions/ISessionCollectionRequest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,14 @@
1313
import java.util.EnumSet;
1414

1515
import com.microsoft.graph.http.IBaseCollectionPage;
16+
import com.microsoft.graph.http.IHttpRequest;
1617

1718
// **NOTE** This file was generated by a tool and any changes will be overwritten.
1819

1920
/**
2021
* The interface for the Session Collection Request.
2122
*/
22-
public interface ISessionCollectionRequest {
23+
public interface ISessionCollectionRequest extends IHttpRequest {
2324

2425
void get(final ICallback<ISessionCollectionPage> callback);
2526

src/main/java/com/microsoft/graph/http/BaseCollectionRequest.java

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import java.net.URL;
2626
import java.util.List;
2727

28+
import com.microsoft.graph.concurrency.IProgressCallback;
2829
import com.microsoft.graph.core.ClientException;
2930
import com.microsoft.graph.core.IBaseClient;
3031
import com.microsoft.graph.httpcore.middlewareoption.IShouldRedirect;
@@ -34,6 +35,8 @@
3435
import com.microsoft.graph.options.Option;
3536
import com.microsoft.graph.options.QueryOption;
3637

38+
import okhttp3.Request;
39+
3740
/**
3841
* A request against a collection
3942
*
@@ -297,4 +300,47 @@ public void setDelay(long delay) {
297300
public long getDelay() {
298301
return baseRequest.getDelay();
299302
}
303+
304+
/**
305+
* Sets the HTTP method and returns the current request
306+
*
307+
* @param httpMethod the HTTP method
308+
* @return the current request
309+
*/
310+
public IHttpRequest withHttpMethod(final HttpMethod httpMethod) {
311+
baseRequest.setHttpMethod(httpMethod);
312+
return this;
313+
}
314+
/**
315+
* Returns the Request object to be executed
316+
* @return the Request object to be executed
317+
*/
318+
@Override
319+
public Request getHttpRequest() throws ClientException {
320+
return baseRequest.getHttpRequest();
321+
}
322+
323+
/**
324+
* Returns the Request object to be executed
325+
* @param serializedObject the object to serialize at the body of the request
326+
* @param <requestBodyType> the type of the serialized object
327+
* @return the Request object to be executed
328+
*/
329+
@Override
330+
public <requestBodyType> Request getHttpRequest(final requestBodyType serializedObject) throws ClientException {
331+
return baseRequest.getHttpRequest(serializedObject);
332+
}
333+
334+
/**
335+
* Returns the Request object to be executed
336+
* @param serializedObject the object to serialize at the body of the request
337+
* @param progress the progress callback
338+
* @param <requestBodyType> the type of the serialized object
339+
* @param <responseType> the type of the response object
340+
* @return the Request object to be executed
341+
*/
342+
@Override
343+
public <requestBodyType, responseType> Request getHttpRequest(final requestBodyType serializedObject, final IProgressCallback<responseType> progress) throws ClientException {
344+
return baseRequest.getHttpRequest(serializedObject, progress);
345+
}
300346
}

src/main/java/com/microsoft/graph/http/BaseRequest.java

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,13 @@
2323
package com.microsoft.graph.http;
2424

2525
import okhttp3.HttpUrl;
26+
import okhttp3.Request;
2627
import okhttp3.HttpUrl.Builder;
2728

2829
import com.microsoft.graph.concurrency.ICallback;
30+
import com.microsoft.graph.concurrency.IProgressCallback;
31+
import com.microsoft.graph.content.MSBatchRequestContent;
32+
import com.microsoft.graph.content.MSBatchRequestStep;
2933
import com.microsoft.graph.core.IBaseClient;
3034
import com.microsoft.graph.httpcore.middlewareoption.IShouldRedirect;
3135
import com.microsoft.graph.httpcore.middlewareoption.IShouldRetry;
@@ -41,9 +45,11 @@
4145
import java.net.MalformedURLException;
4246
import java.net.URL;
4347
import java.util.ArrayList;
48+
import java.util.Arrays;
4449
import java.util.Collections;
4550
import java.util.LinkedList;
4651
import java.util.List;
52+
import java.util.concurrent.ThreadLocalRandom;
4753

4854
/**
4955
* An HTTP request
@@ -190,6 +196,40 @@ public URL getRequestUrl() {
190196
return null;
191197
}
192198

199+
/**
200+
* Returns the Request object to be executed
201+
* @return the Request object to be executed
202+
*/
203+
@Override
204+
public Request getHttpRequest() throws ClientException {
205+
return getHttpRequest(null);
206+
}
207+
208+
/**
209+
* Returns the Request object to be executed
210+
* @param serializedObject the object to serialize at the body of the request
211+
* @param <requestBodyType> the type of the serialized object
212+
* @return the Request object to be executed
213+
*/
214+
@Override
215+
public <requestBodyType> Request getHttpRequest(final requestBodyType serializedObject) throws ClientException {
216+
return getHttpRequest(serializedObject, null);
217+
}
218+
219+
/**
220+
* Returns the Request object to be executed
221+
* @param serializedObject the object to serialize at the body of the request
222+
* @param progress the progress callback
223+
* @param <requestBodyType> the type of the serialized object
224+
* @param <responseType> the type of the response object
225+
* @return the Request object to be executed
226+
*/
227+
@SuppressWarnings("unchecked")
228+
@Override
229+
public <requestBodyType, responseType> Request getHttpRequest(final requestBodyType serializedObject, final IProgressCallback<responseType> progress) throws ClientException {
230+
return client.getHttpProvider().getHttpRequest(this, (Class<responseType>) responseClass, serializedObject, progress);
231+
}
232+
193233
private String addFunctionParameters() {
194234
final StringBuilder requestUrl = new StringBuilder(this.requestUrl);
195235

@@ -363,6 +403,17 @@ public void setHttpMethod(final HttpMethod httpMethod) {
363403
method = httpMethod;
364404
}
365405

406+
/**
407+
* Sets the HTTP method and returns the current request
408+
*
409+
* @param httpMethod the HTTP method
410+
* @return the current request
411+
*/
412+
public IHttpRequest withHttpMethod(final HttpMethod httpMethod) {
413+
method = httpMethod;
414+
return this;
415+
}
416+
366417
/**
367418
* Gets the client
368419
*

src/main/java/com/microsoft/graph/http/BaseStreamRequest.java

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
package com.microsoft.graph.http;
2424

2525
import com.microsoft.graph.concurrency.ICallback;
26+
import com.microsoft.graph.concurrency.IProgressCallback;
2627
import com.microsoft.graph.core.ClientException;
2728
import com.microsoft.graph.core.IBaseClient;
2829
import com.microsoft.graph.httpcore.middlewareoption.IShouldRedirect;
@@ -32,6 +33,8 @@
3233
import com.microsoft.graph.options.HeaderOption;
3334
import com.microsoft.graph.options.Option;
3435

36+
import okhttp3.Request;
37+
3538
import java.io.InputStream;
3639
import java.net.URL;
3740
import java.util.List;
@@ -269,5 +272,48 @@ public void setDelay(long delay) {
269272
public long getDelay() {
270273
return baseRequest.getDelay();
271274
}
272-
275+
/**
276+
* Sets the HTTP method and returns the current request
277+
*
278+
* @param httpMethod the HTTP method
279+
* @return the current request
280+
*/
281+
@Override
282+
public IHttpRequest withHttpMethod(final HttpMethod httpMethod) {
283+
baseRequest.setHttpMethod(httpMethod);
284+
return this;
285+
}
286+
287+
/**
288+
* Returns the Request object to be executed
289+
* @return the Request object to be executed
290+
*/
291+
@Override
292+
public Request getHttpRequest() throws ClientException {
293+
return baseRequest.getHttpRequest();
294+
}
295+
296+
/**
297+
* Returns the Request object to be executed
298+
* @param serializedObject the object to serialize at the body of the request
299+
* @param <requestBodyType> the type of the serialized object
300+
* @return the Request object to be executed
301+
*/
302+
@Override
303+
public <requestBodyType> Request getHttpRequest(final requestBodyType serializedObject) throws ClientException {
304+
return baseRequest.getHttpRequest(serializedObject);
305+
}
306+
307+
/**
308+
* Returns the Request object to be executed
309+
* @param serializedObject the object to serialize at the body of the request
310+
* @param progress the progress callback
311+
* @param <requestBodyType> the type of the serialized object
312+
* @param <responseType> the type of the response object
313+
* @return the Request object to be executed
314+
*/
315+
@Override
316+
public <requestBodyType, responseType> Request getHttpRequest(final requestBodyType serializedObject, final IProgressCallback<responseType> progress) throws ClientException {
317+
return baseRequest.getHttpRequest(serializedObject, progress);
318+
}
273319
}

0 commit comments

Comments
 (0)