Skip to content

Commit dc07e41

Browse files
committed
- updates unit test files for java odata cast
1 parent e7b12dd commit dc07e41

File tree

71 files changed

+4470
-7
lines changed

Some content is hidden

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

71 files changed

+4470
-7
lines changed
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
// ------------------------------------------------------------------------------
2+
// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
3+
// ------------------------------------------------------------------------------
4+
5+
package com.microsoft.graph.models.extensions;
6+
import com.microsoft.graph.serializer.ISerializer;
7+
import com.microsoft.graph.serializer.IJsonBackedObject;
8+
import com.microsoft.graph.serializer.AdditionalDataManager;
9+
import java.util.EnumSet;
10+
import com.microsoft.graph.models.extensions.Entity;
11+
12+
13+
import com.google.gson.JsonObject;
14+
import com.google.gson.annotations.SerializedName;
15+
import com.google.gson.annotations.Expose;
16+
17+
// **NOTE** This file was generated by a tool and any changes will be overwritten.
18+
19+
/**
20+
* The class for the Directory Object.
21+
*/
22+
public class DirectoryObject extends Entity implements IJsonBackedObject {
23+
24+
25+
/**
26+
* The Deleted Date Time.
27+
*
28+
*/
29+
@SerializedName("deletedDateTime")
30+
@Expose
31+
public java.util.Calendar deletedDateTime;
32+
33+
34+
/**
35+
* The raw representation of this class
36+
*/
37+
private JsonObject rawObject;
38+
39+
/**
40+
* The serializer
41+
*/
42+
private ISerializer serializer;
43+
44+
/**
45+
* Gets the raw representation of this class
46+
*
47+
* @return the raw representation of this class
48+
*/
49+
public JsonObject getRawObject() {
50+
return rawObject;
51+
}
52+
53+
/**
54+
* Gets serializer
55+
*
56+
* @return the serializer
57+
*/
58+
protected ISerializer getSerializer() {
59+
return serializer;
60+
}
61+
62+
/**
63+
* Sets the raw JSON object
64+
*
65+
* @param serializer the serializer
66+
* @param json the JSON object to set this object to
67+
*/
68+
public void setRawObject(final ISerializer serializer, final JsonObject json) {
69+
this.serializer = serializer;
70+
rawObject = json;
71+
72+
}
73+
}
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
// ------------------------------------------------------------------------------
2+
// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
3+
// ------------------------------------------------------------------------------
4+
5+
package com.microsoft.graph.models.extensions;
6+
import com.microsoft.graph.serializer.ISerializer;
7+
import com.microsoft.graph.serializer.IJsonBackedObject;
8+
import com.microsoft.graph.serializer.AdditionalDataManager;
9+
import java.util.EnumSet;
10+
import com.microsoft.graph.models.extensions.DirectoryObject;
11+
import com.microsoft.graph.models.extensions.User;
12+
import com.microsoft.graph.models.extensions.Group;
13+
import com.microsoft.graph.requests.extensions.DirectoryObjectCollectionPage;
14+
import com.microsoft.graph.requests.extensions.UserCollectionPage;
15+
import com.microsoft.graph.requests.extensions.GroupCollectionPage;
16+
17+
18+
import com.google.gson.JsonObject;
19+
import com.google.gson.annotations.SerializedName;
20+
import com.google.gson.annotations.Expose;
21+
22+
// **NOTE** This file was generated by a tool and any changes will be overwritten.
23+
24+
/**
25+
* The class for the Group.
26+
*/
27+
public class Group extends DirectoryObject implements IJsonBackedObject {
28+
29+
30+
/**
31+
* The Members.
32+
* Users and groups that are members of this Adminsitrative Unit. HTTP Methods: GET (list members), POST (add members), DELETE (remove members).
33+
*/
34+
public DirectoryObjectCollectionPage members;
35+
36+
/**
37+
* The Members As User.
38+
* Users and groups that are members of this Adminsitrative Unit. HTTP Methods: GET (list members), POST (add members), DELETE (remove members).
39+
*/
40+
public UserCollectionPage membersAsUser;
41+
42+
/**
43+
* The Members As Group.
44+
* Users and groups that are members of this Adminsitrative Unit. HTTP Methods: GET (list members), POST (add members), DELETE (remove members).
45+
*/
46+
public GroupCollectionPage membersAsGroup;
47+
48+
49+
/**
50+
* The raw representation of this class
51+
*/
52+
private JsonObject rawObject;
53+
54+
/**
55+
* The serializer
56+
*/
57+
private ISerializer serializer;
58+
59+
/**
60+
* Gets the raw representation of this class
61+
*
62+
* @return the raw representation of this class
63+
*/
64+
public JsonObject getRawObject() {
65+
return rawObject;
66+
}
67+
68+
/**
69+
* Gets serializer
70+
*
71+
* @return the serializer
72+
*/
73+
protected ISerializer getSerializer() {
74+
return serializer;
75+
}
76+
77+
/**
78+
* Sets the raw JSON object
79+
*
80+
* @param serializer the serializer
81+
* @param json the JSON object to set this object to
82+
*/
83+
public void setRawObject(final ISerializer serializer, final JsonObject json) {
84+
this.serializer = serializer;
85+
rawObject = json;
86+
87+
88+
if (json.has("members")) {
89+
members = serializer.deserializeObject(json.get("members").toString(), DirectoryObjectCollectionPage.class);
90+
}
91+
92+
if (json.has("membersAsUser")) {
93+
membersAsUser = serializer.deserializeObject(json.get("membersAsUser").toString(), UserCollectionPage.class);
94+
}
95+
96+
if (json.has("membersAsGroup")) {
97+
membersAsGroup = serializer.deserializeObject(json.get("membersAsGroup").toString(), GroupCollectionPage.class);
98+
}
99+
}
100+
}
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
// ------------------------------------------------------------------------------
2+
// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
3+
// ------------------------------------------------------------------------------
4+
5+
package com.microsoft.graph.models.extensions;
6+
import com.microsoft.graph.serializer.ISerializer;
7+
import com.microsoft.graph.serializer.IJsonBackedObject;
8+
import com.microsoft.graph.serializer.AdditionalDataManager;
9+
import java.util.EnumSet;
10+
import com.microsoft.graph.models.extensions.DirectoryObject;
11+
12+
13+
import com.google.gson.JsonObject;
14+
import com.google.gson.annotations.SerializedName;
15+
import com.google.gson.annotations.Expose;
16+
17+
// **NOTE** This file was generated by a tool and any changes will be overwritten.
18+
19+
/**
20+
* The class for the User.
21+
*/
22+
public class User extends DirectoryObject implements IJsonBackedObject {
23+
24+
25+
/**
26+
* The Account Enabled.
27+
* true if the account is enabled; otherwise, false. This property is required when a user is created. Supports $filter.
28+
*/
29+
@SerializedName("accountEnabled")
30+
@Expose
31+
public Boolean accountEnabled;
32+
33+
34+
/**
35+
* The raw representation of this class
36+
*/
37+
private JsonObject rawObject;
38+
39+
/**
40+
* The serializer
41+
*/
42+
private ISerializer serializer;
43+
44+
/**
45+
* Gets the raw representation of this class
46+
*
47+
* @return the raw representation of this class
48+
*/
49+
public JsonObject getRawObject() {
50+
return rawObject;
51+
}
52+
53+
/**
54+
* Gets serializer
55+
*
56+
* @return the serializer
57+
*/
58+
protected ISerializer getSerializer() {
59+
return serializer;
60+
}
61+
62+
/**
63+
* Sets the raw JSON object
64+
*
65+
* @param serializer the serializer
66+
* @param json the JSON object to set this object to
67+
*/
68+
public void setRawObject(final ISerializer serializer, final JsonObject json) {
69+
this.serializer = serializer;
70+
rawObject = json;
71+
72+
}
73+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
// ------------------------------------------------------------------------------
2+
// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
3+
// ------------------------------------------------------------------------------
4+
5+
package com.microsoft.graph.requests.extensions;
6+
7+
import com.microsoft.graph.http.IRequestBuilder;
8+
import com.microsoft.graph.core.ClientException;
9+
import com.microsoft.graph.concurrency.ICallback;
10+
import com.microsoft.graph.models.extensions.Group;
11+
import com.microsoft.graph.models.extensions.DirectoryObject;
12+
import java.util.Arrays;
13+
import java.util.EnumSet;
14+
15+
import com.microsoft.graph.options.QueryOption;
16+
import com.microsoft.graph.core.IBaseClient;
17+
import com.microsoft.graph.http.BaseCollectionRequest;
18+
import com.microsoft.graph.http.ReferenceRequestBody;
19+
import com.microsoft.graph.models.extensions.DirectoryObject;
20+
21+
// **NOTE** This file was generated by a tool and any changes will be overwritten.
22+
23+
/**
24+
* The class for the Directory Object Collection Reference Request.
25+
*/
26+
public class DirectoryObjectCollectionReferenceRequest extends BaseCollectionRequest<DirectoryObjectCollectionResponse, IDirectoryObjectCollectionPage> implements IDirectoryObjectCollectionReferenceRequest {
27+
28+
/**
29+
* The request builder for this collection of DirectoryObject
30+
*
31+
* @param requestUrl the request URL
32+
* @param client the service client
33+
* @param requestOptions the options for this request
34+
*/
35+
public DirectoryObjectCollectionReferenceRequest(final String requestUrl, IBaseClient client, final java.util.List<? extends com.microsoft.graph.options.Option> requestOptions) {
36+
super(requestUrl, client, requestOptions, DirectoryObjectCollectionResponse.class, IDirectoryObjectCollectionPage.class);
37+
}
38+
39+
/**
40+
* Sets the expand clause for the request
41+
*
42+
* @param value the expand clause
43+
* @return the updated request
44+
*/
45+
public IDirectoryObjectCollectionReferenceRequest expand(final String value) {
46+
addQueryOption(new com.microsoft.graph.options.QueryOption("$expand", value));
47+
return (DirectoryObjectCollectionReferenceRequest)this;
48+
}
49+
50+
/**
51+
* Sets the filter clause for the request
52+
*
53+
* @param value the filter clause
54+
* @return the updated request
55+
*/
56+
public IDirectoryObjectCollectionReferenceRequest filter(final String value) {
57+
addQueryOption(new com.microsoft.graph.options.QueryOption("$filter", value));
58+
return (DirectoryObjectCollectionReferenceRequest)this;
59+
}
60+
61+
/**
62+
* Sets the order by clause for the request
63+
*
64+
* @param value the sort clause
65+
* @return the updated request
66+
*/
67+
public IDirectoryObjectCollectionReferenceRequest orderBy(final String value) {
68+
addQueryOption(new com.microsoft.graph.options.QueryOption("$orderby", value));
69+
return (DirectoryObjectCollectionReferenceRequest)this;
70+
}
71+
72+
/**
73+
* Sets the select clause for the request
74+
*
75+
* @param value the select clause
76+
* @return the updated request
77+
*/
78+
public IDirectoryObjectCollectionReferenceRequest select(final String value) {
79+
addQueryOption(new com.microsoft.graph.options.QueryOption("$select", value));
80+
return (DirectoryObjectCollectionReferenceRequest)this;
81+
}
82+
83+
/**
84+
* Sets the top value for the request
85+
*
86+
* @param value the max number of items to return
87+
* @return the updated request
88+
*/
89+
public IDirectoryObjectCollectionReferenceRequest top(final int value) {
90+
addQueryOption(new com.microsoft.graph.options.QueryOption("$top", value + ""));
91+
return (DirectoryObjectCollectionReferenceRequest)this;
92+
}
93+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
// ------------------------------------------------------------------------------
2+
// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
3+
// ------------------------------------------------------------------------------
4+
5+
package com.microsoft.graph.requests.extensions;
6+
7+
import com.microsoft.graph.http.IRequestBuilder;
8+
import com.microsoft.graph.core.ClientException;
9+
import com.microsoft.graph.concurrency.ICallback;
10+
import com.microsoft.graph.models.extensions.Group;
11+
import com.microsoft.graph.models.extensions.DirectoryObject;
12+
import java.util.Arrays;
13+
import java.util.EnumSet;
14+
15+
import com.microsoft.graph.http.BaseRequestBuilder;
16+
import com.microsoft.graph.core.IBaseClient;
17+
18+
// **NOTE** This file was generated by a tool and any changes will be overwritten.
19+
20+
/**
21+
* The class for the Directory Object Collection Reference Request Builder.
22+
*/
23+
public class DirectoryObjectCollectionReferenceRequestBuilder extends BaseRequestBuilder implements IDirectoryObjectCollectionReferenceRequestBuilder {
24+
25+
/**
26+
* The request builder for this collection of Group
27+
*
28+
* @param requestUrl the request URL
29+
* @param client the service client
30+
* @param requestOptions the options for this request
31+
*/
32+
public DirectoryObjectCollectionReferenceRequestBuilder(final String requestUrl, final IBaseClient client, final java.util.List<? extends com.microsoft.graph.options.Option> requestOptions) {
33+
super(requestUrl, client, requestOptions);
34+
}
35+
36+
/**
37+
* Creates the request
38+
*
39+
* @param requestOptions the options for this request
40+
* @return the IUserRequest instance
41+
*/
42+
public IDirectoryObjectCollectionReferenceRequest buildRequest(final com.microsoft.graph.options.Option... requestOptions) {
43+
return buildRequest(getOptions(requestOptions));
44+
}
45+
46+
/**
47+
* Creates the request
48+
*
49+
* @param requestOptions the options for this request
50+
* @return the IUserRequest instance
51+
*/
52+
public IDirectoryObjectCollectionReferenceRequest buildRequest(final java.util.List<? extends com.microsoft.graph.options.Option> requestOptions) {
53+
return new DirectoryObjectCollectionReferenceRequest(getRequestUrl(), getClient(), requestOptions);
54+
}
55+
}

0 commit comments

Comments
 (0)