Skip to content

Commit b5da1c5

Browse files
committed
Merge branch 'feature/v2' into bugfix/collection-responses
2 parents 36e4b6b + 1930509 commit b5da1c5

14 files changed

Lines changed: 42 additions & 172 deletions

‎gradle.properties‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ org.gradle.jvmargs=-XX:MaxPermSize=512m -Xmx2g
2323

2424
mavenGroupId = com.microsoft.graph
2525
mavenArtifactId = microsoft-graph-core
26-
mavenMajorVersion = 1
26+
mavenMajorVersion = 2
2727
mavenMinorVersion = 0
28-
mavenPatchVersion = 7
28+
mavenPatchVersion = 0
2929
mavenArtifactSuffix =
3030
nightliesUrl = http://dl.bintray.com/MicrosoftGraph/Maven
3131

‎readme.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ repositories {
2020
2121
dependencies {
2222
// Include the sdk as a dependency
23-
implementation 'com.microsoft.graph:microsoft-graph-core:1.0.7'
23+
implementation 'com.microsoft.graph:microsoft-graph-core:2.0.0'
2424
}
2525
```
2626

@@ -32,7 +32,7 @@ Add the dependency in `dependencies` in pom.xml
3232
<dependency>
3333
<groupId>com.microsoft.graph</groupId>
3434
<artifactId>microsoft-graph-core</artifactId>
35-
<version>1.0.7</version>
35+
<version>2.0.0</version>
3636
</dependency>
3737
```
3838

‎src/main/java/com/microsoft/graph/http/BaseCollectionPage.java‎

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,6 @@ public class BaseCollectionPage<T, T2 extends BaseRequestBuilder<T>> implements
5353
*/
5454
private final T2 requestBuilder;
5555

56-
/**
57-
* The raw representation of this class
58-
*/
59-
private JsonObject rawObject;
60-
61-
/**
62-
* The serializer
63-
*/
64-
private ISerializer serializer;
65-
6656
/**
6757
* A collection page for WorkforceIntegration
6858
*
@@ -118,36 +108,13 @@ public List<T> getCurrentPage() {
118108
return pageContents;
119109
}
120110

121-
/**
122-
* Gets the raw representation of this class
123-
*
124-
* @return the raw representation of this class
125-
*/
126-
@Nullable
127-
public JsonObject getRawObject() {
128-
return rawObject;
129-
}
130-
131-
/**
132-
* Gets the serializer
133-
*
134-
* @return the serializer
135-
*/
136-
@Override
137-
@Nullable
138-
public ISerializer getSerializer() {
139-
return serializer;
140-
}
141-
142111
/**
143112
* Sets the raw JSON object
144113
*
145114
* @param serializer the serializer
146115
* @param json the JSON object to set this object to
147116
*/
148117
public void setRawObject(@Nonnull final ISerializer serializer, @Nonnull final JsonObject json) {
149-
this.serializer = serializer;
150-
rawObject = json;
151118
}
152119

153120
@Override

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ public T3 buildFromResponse(@Nonnull final T2 response) {
130130
.getConstructor(String.class, IBaseClient.class, java.util.List.class)
131131
.newInstance(response.nextLink(), getBaseRequest().getClient(), options);
132132
final T3 page = (T3)this.collectionPageClass.getConstructor(response.getClass(), builder.getClass()).newInstance(response, response.nextLink() == null ? null : builder);
133-
page.setRawObject(response.getSerializer(), response.getRawObject());
134133
return page;
135134
} catch(IllegalArgumentException | InstantiationException | IllegalAccessException | InvocationTargetException | NoSuchMethodException | SecurityException ex) {
136135
return null;

‎src/main/java/com/microsoft/graph/http/BaseCollectionResponse.java‎

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -57,48 +57,13 @@ public final AdditionalDataManager additionalDataManager() {
5757
return additionalDataManager;
5858
}
5959

60-
/**
61-
* The raw representation of this class
62-
*/
63-
@Nullable
64-
protected JsonObject rawObject;
65-
66-
/**
67-
* The serializer
68-
*/
69-
@Nullable
70-
protected ISerializer serializer;
71-
72-
/**
73-
* Gets the raw representation of this class
74-
*
75-
* @return the raw representation of this class
76-
*/
77-
@Nullable
78-
public JsonObject getRawObject() {
79-
return rawObject;
80-
}
81-
82-
/**
83-
* Gets serializer
84-
*
85-
* @return the serializer
86-
*/
87-
@Override
88-
@Nullable
89-
public ISerializer getSerializer() {
90-
return serializer;
91-
}
92-
9360
/**
9461
* Sets the raw JSON object
9562
*
9663
* @param serializer the serializer
9764
* @param json the JSON object to set this object to
9865
*/
9966
public void setRawObject(@Nonnull final ISerializer serializer, @Nonnull final JsonObject json) {
100-
this.serializer = serializer;
101-
rawObject = json;
10267
if (json.has("value")) {
10368
final JsonArray array = json.getAsJsonArray("value");
10469
for (int i = 0; i < array.size(); i++) {

‎src/main/java/com/microsoft/graph/http/DeltaCollectionPage.java‎

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
// ------------------------------------------------------------------------------
22
// Copyright (c) 2017 Microsoft Corporation
3-
//
3+
//
44
// Permission is hereby granted, free of charge, to any person obtaining a copy
55
// of this software and associated documentation files (the "Software"), to deal
66
// in the Software without restriction, including without limitation the rights
77
// to use, copy, modify, merge, publish, distribute, sub-license, and/or sell
88
// copies of the Software, and to permit persons to whom the Software is
99
// furnished to do so, subject to the following conditions:
10-
//
10+
//
1111
// The above copyright notice and this permission notice shall be included in
1212
// all copies or substantial portions of the Software.
13-
//
13+
//
1414
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1515
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1616
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -22,11 +22,8 @@
2222

2323
package com.microsoft.graph.http;
2424

25-
import com.google.gson.JsonObject;
26-
import com.microsoft.graph.serializer.AdditionalDataManager;
27-
import com.microsoft.graph.serializer.ISerializer;
25+
import com.google.gson.JsonElement;
2826

29-
import java.util.Collections;
3027
import java.util.List;
3128

3229
import javax.annotation.Nullable;
@@ -39,7 +36,7 @@
3936
*/
4037
public class DeltaCollectionPage<T, T2 extends BaseRequestBuilder<T>> extends BaseCollectionPage<T, T2> {
4138
/**
42-
* The opaque link to query delta after the
39+
* The opaque link to query delta after the
4340
* initial request
4441
*/
4542
@Nullable
@@ -53,8 +50,9 @@ public class DeltaCollectionPage<T, T2 extends BaseRequestBuilder<T>> extends Ba
5350
*/
5451
public DeltaCollectionPage(@Nonnull final ICollectionResponse<T> response, @Nullable final T2 builder) {
5552
super(response.values(), builder, response.additionalDataManager());
56-
if (response.getRawObject().get("@odata.deltaLink") != null) {
57-
deltaLink = response.getRawObject().get("@odata.deltaLink").getAsString();
53+
final JsonElement deltaLinkRaw = response.additionalDataManager().get("@odata.deltaLink");
54+
if (deltaLinkRaw != null) {
55+
deltaLink = deltaLinkRaw.getAsString();
5856
} else {
5957
deltaLink = null;
6058
}

‎src/main/java/com/microsoft/graph/http/GraphErrorResponse.java‎

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
// ------------------------------------------------------------------------------
22
// Copyright (c) 2017 Microsoft Corporation
3-
//
3+
//
44
// Permission is hereby granted, free of charge, to any person obtaining a copy
55
// of this software and associated documentation files (the "Software"), to deal
66
// in the Software without restriction, including without limitation the rights
77
// to use, copy, modify, merge, publish, distribute, sub-license, and/or sell
88
// copies of the Software, and to permit persons to whom the Software is
99
// furnished to do so, subject to the following conditions:
10-
//
10+
//
1111
// The above copyright notice and this permission notice shall be included in
1212
// all copies or substantial portions of the Software.
13-
//
13+
//
1414
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1515
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1616
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -66,22 +66,4 @@ public void setRawObject(@Nullable final ISerializer serializer, @Nonnull final
6666
public final AdditionalDataManager additionalDataManager() {
6767
return additionalDataManager;
6868
}
69-
70-
@Override
71-
@Nullable
72-
public ISerializer getSerializer() {
73-
return null;
74-
}
75-
76-
/**
77-
* Gets the raw JSON object for this object as parsed from
78-
* @return the JSON that this object was derived from
79-
*/
80-
@Override
81-
@Nullable
82-
public JsonObject getRawObject() {
83-
return rawObject;
84-
}
8569
}
86-
87-

‎src/main/java/com/microsoft/graph/http/ICollectionResponse.java‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,13 @@
55
import javax.annotation.Nullable;
66

77
import com.microsoft.graph.serializer.IJsonBackedObject;
8-
import com.microsoft.graph.serializer.ISerializer;
98

109
/**
1110
* Represents a response of a collection of items returned by the service
1211
* @param <T> the type for the items in the response.
1312
*/
1413
public interface ICollectionResponse<T> extends IJsonBackedObject{
15-
/**
14+
/**
1615
* Gets the deserialized values the response contains
1716
* @return the deserialized values for the response
1817
*/

‎src/main/java/com/microsoft/graph/http/ReferenceRequestBody.java‎

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,6 @@ public class ReferenceRequestBody implements IJsonBackedObject {
4444
@Nonnull
4545
public String odataId;
4646

47-
/**
48-
* The raw representation of this class
49-
*/
50-
private JsonObject rawObject;
51-
52-
/**
53-
* The serializer
54-
*/
55-
private ISerializer serializer;
56-
5747
/**
5848
* Instanciates a new reference request body from the serialized payload
5949
* @param payload payload to instanciate the body from
@@ -62,36 +52,13 @@ public ReferenceRequestBody(@Nonnull final String payload) {
6252
odataId = payload;
6353
}
6454

65-
/**
66-
* Gets the raw representation of this class
67-
*
68-
* @return the raw representation of this class
69-
*/
70-
@Nullable
71-
public JsonObject getRawObject() {
72-
return rawObject;
73-
}
74-
75-
/**
76-
* Gets serializer
77-
*
78-
* @return the serializer
79-
*/
80-
@Nullable
81-
@Override
82-
public ISerializer getSerializer() {
83-
return serializer;
84-
}
85-
8655
/**
8756
* Sets the raw JSON object
8857
*
8958
* @param serializer the serializer
9059
* @param json the JSON object to set this object to
9160
*/
9261
public void setRawObject(@Nonnull final ISerializer serializer, @Nonnull final JsonObject json) {
93-
this.serializer = serializer;
94-
this.rawObject = json;
9562
}
9663

9764
@Override

‎src/main/java/com/microsoft/graph/httpcore/TelemetryHandler.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public class TelemetryHandler implements Interceptor{
2525
/**
2626
* Current SDK version
2727
*/
28-
public static final String VERSION = "v1.0.7";
28+
public static final String VERSION = "v2.0.0";
2929
/**
3030
* Verion prefix
3131
*/

0 commit comments

Comments
 (0)