1212import java .util .EnumSet ;
1313import com .microsoft .graph .models .generated .CalendarColor ;
1414import com .microsoft .graph .models .extensions .EmailAddress ;
15- import com .microsoft .graph .models .extensions .Event ;
1615import com .microsoft .graph .models .extensions .SingleValueLegacyExtendedProperty ;
1716import com .microsoft .graph .models .extensions .MultiValueLegacyExtendedProperty ;
17+ import com .microsoft .graph .models .extensions .Event ;
1818import com .microsoft .graph .models .extensions .Entity ;
19- import com .microsoft .graph .requests .extensions .EventCollectionResponse ;
20- import com .microsoft .graph .requests .extensions .EventCollectionPage ;
2119import com .microsoft .graph .requests .extensions .SingleValueLegacyExtendedPropertyCollectionResponse ;
2220import com .microsoft .graph .requests .extensions .SingleValueLegacyExtendedPropertyCollectionPage ;
2321import com .microsoft .graph .requests .extensions .MultiValueLegacyExtendedPropertyCollectionResponse ;
2422import com .microsoft .graph .requests .extensions .MultiValueLegacyExtendedPropertyCollectionPage ;
23+ import com .microsoft .graph .requests .extensions .EventCollectionResponse ;
24+ import com .microsoft .graph .requests .extensions .EventCollectionPage ;
2525
2626
2727import com .google .gson .JsonObject ;
@@ -94,18 +94,6 @@ public class Calendar extends Entity implements IJsonBackedObject {
9494 @ Expose
9595 public EmailAddress owner ;
9696
97- /**
98- * The Events.
99- * The events in the calendar. Navigation property. Read-only.
100- */
101- public EventCollectionPage events ;
102-
103- /**
104- * The Calendar View.
105- * The calendar view for the calendar. Navigation property. Read-only.
106- */
107- public EventCollectionPage calendarView ;
108-
10997 /**
11098 * The Single Value Extended Properties.
11199 * The collection of single-value extended properties defined for the calendar. Read-only. Nullable.
@@ -118,6 +106,18 @@ public class Calendar extends Entity implements IJsonBackedObject {
118106 */
119107 public MultiValueLegacyExtendedPropertyCollectionPage multiValueExtendedProperties ;
120108
109+ /**
110+ * The Events.
111+ * The events in the calendar. Navigation property. Read-only.
112+ */
113+ public EventCollectionPage events ;
114+
115+ /**
116+ * The Calendar View.
117+ * The calendar view for the calendar. Navigation property. Read-only.
118+ */
119+ public EventCollectionPage calendarView ;
120+
121121
122122 /**
123123 * The raw representation of this class
@@ -158,38 +158,6 @@ public void setRawObject(final ISerializer serializer, final JsonObject json) {
158158 rawObject = json ;
159159
160160
161- if (json .has ("events" )) {
162- final EventCollectionResponse response = new EventCollectionResponse ();
163- if (
json .
has (
"[email protected] " )) {
164- response .
nextLink =
json .
get (
"[email protected] " ).
getAsString ();
165- }
166-
167- final JsonObject [] sourceArray = serializer .deserializeObject (json .get ("events" ).toString (), JsonObject [].class );
168- final Event [] array = new Event [sourceArray .length ];
169- for (int i = 0 ; i < sourceArray .length ; i ++) {
170- array [i ] = serializer .deserializeObject (sourceArray [i ].toString (), Event .class );
171- array [i ].setRawObject (serializer , sourceArray [i ]);
172- }
173- response .value = Arrays .asList (array );
174- events = new EventCollectionPage (response , null );
175- }
176-
177- if (json .has ("calendarView" )) {
178- final EventCollectionResponse response = new EventCollectionResponse ();
179- if (
json .
has (
"[email protected] " )) {
180- response .
nextLink =
json .
get (
"[email protected] " ).
getAsString ();
181- }
182-
183- final JsonObject [] sourceArray = serializer .deserializeObject (json .get ("calendarView" ).toString (), JsonObject [].class );
184- final Event [] array = new Event [sourceArray .length ];
185- for (int i = 0 ; i < sourceArray .length ; i ++) {
186- array [i ] = serializer .deserializeObject (sourceArray [i ].toString (), Event .class );
187- array [i ].setRawObject (serializer , sourceArray [i ]);
188- }
189- response .value = Arrays .asList (array );
190- calendarView = new EventCollectionPage (response , null );
191- }
192-
193161 if (json .has ("singleValueExtendedProperties" )) {
194162 final SingleValueLegacyExtendedPropertyCollectionResponse response = new SingleValueLegacyExtendedPropertyCollectionResponse ();
195163 if (
json .
has (
"[email protected] " )) {
@@ -221,5 +189,37 @@ public void setRawObject(final ISerializer serializer, final JsonObject json) {
221189 response .value = Arrays .asList (array );
222190 multiValueExtendedProperties = new MultiValueLegacyExtendedPropertyCollectionPage (response , null );
223191 }
192+
193+ if (json .has ("events" )) {
194+ final EventCollectionResponse response = new EventCollectionResponse ();
195+ if (
json .
has (
"[email protected] " )) {
196+ response .
nextLink =
json .
get (
"[email protected] " ).
getAsString ();
197+ }
198+
199+ final JsonObject [] sourceArray = serializer .deserializeObject (json .get ("events" ).toString (), JsonObject [].class );
200+ final Event [] array = new Event [sourceArray .length ];
201+ for (int i = 0 ; i < sourceArray .length ; i ++) {
202+ array [i ] = serializer .deserializeObject (sourceArray [i ].toString (), Event .class );
203+ array [i ].setRawObject (serializer , sourceArray [i ]);
204+ }
205+ response .value = Arrays .asList (array );
206+ events = new EventCollectionPage (response , null );
207+ }
208+
209+ if (json .has ("calendarView" )) {
210+ final EventCollectionResponse response = new EventCollectionResponse ();
211+ if (
json .
has (
"[email protected] " )) {
212+ response .
nextLink =
json .
get (
"[email protected] " ).
getAsString ();
213+ }
214+
215+ final JsonObject [] sourceArray = serializer .deserializeObject (json .get ("calendarView" ).toString (), JsonObject [].class );
216+ final Event [] array = new Event [sourceArray .length ];
217+ for (int i = 0 ; i < sourceArray .length ; i ++) {
218+ array [i ] = serializer .deserializeObject (sourceArray [i ].toString (), Event .class );
219+ array [i ].setRawObject (serializer , sourceArray [i ]);
220+ }
221+ response .value = Arrays .asList (array );
222+ calendarView = new EventCollectionPage (response , null );
223+ }
224224 }
225225}
0 commit comments