Skip to content

Commit 306a5b9

Browse files
author
Caitlin Bales (MSFT)
committed
Extend hashmaps for Planner collections
1 parent 1112388 commit 306a5b9

File tree

5 files changed

+23
-4
lines changed

5 files changed

+23
-4
lines changed

src/main/java/com/microsoft/graph/models/extensions/PlannerChecklistItems.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
package com.microsoft.graph.models.extensions;
66

7+
import com.google.gson.JsonPrimitive;
78
import com.microsoft.graph.concurrency.*;
89
import com.microsoft.graph.core.*;
910
import com.microsoft.graph.models.extensions.*;
@@ -16,12 +17,29 @@
1617

1718
import java.util.Arrays;
1819
import java.util.EnumSet;
20+
import java.util.UUID;
1921

2022
// This file is available for extending, afterwards please submit a pull request.
2123

2224
/**
2325
* The class for the Planner Checklist Items.
2426
*/
2527
public class PlannerChecklistItems extends BasePlannerChecklistItems {
28+
/**
29+
* Create a new checklist item with the given title
30+
* @param title Title of the checklist item
31+
* @return The ID of the checklist item
32+
*/
33+
public String addChecklistItem(String title) {
34+
PlannerChecklistItem plannerChecklistItem = new PlannerChecklistItem();
35+
plannerChecklistItem.title = title;
36+
String newChecklistItemId = UUID.randomUUID().toString();
37+
38+
ISerializer serializer = this.getSerializer();
39+
String serializedItem = serializer.serializeObject(plannerChecklistItem);
2640

41+
this.additionalDataManager().put(newChecklistItemId, new JsonPrimitive(serializedItem));
42+
43+
return newChecklistItemId;
44+
}
2745
}

src/main/java/com/microsoft/graph/models/generated/BasePlannerAssignments.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
/**
2929
* The class for the Base Planner Assignments.
3030
*/
31-
public class BasePlannerAssignments implements IJsonBackedObject {
31+
public class BasePlannerAssignments extends HashMap<String, PlannerAssignment> implements IJsonBackedObject {
3232

3333
@SerializedName("@odata.type")
3434
@Expose(serialize = false)

src/main/java/com/microsoft/graph/models/generated/BasePlannerChecklistItems.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
/**
2929
* The class for the Base Planner Checklist Items.
3030
*/
31-
public class BasePlannerChecklistItems implements IJsonBackedObject {
31+
public class BasePlannerChecklistItems extends HashMap<String, PlannerChecklistItem> implements IJsonBackedObject {
3232

3333
@SerializedName("@odata.type")
3434
@Expose(serialize = false)

src/main/java/com/microsoft/graph/models/generated/BasePlannerExternalReferences.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
/**
2929
* The class for the Base Planner External References.
3030
*/
31-
public class BasePlannerExternalReferences implements IJsonBackedObject {
31+
public class BasePlannerExternalReferences extends HashMap<String, String> implements IJsonBackedObject {
3232

3333
@SerializedName("@odata.type")
3434
@Expose(serialize = false)

src/main/java/com/microsoft/graph/models/generated/BasePlannerUserIds.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import com.microsoft.graph.options.*;
1515
import com.microsoft.graph.serializer.*;
1616

17+
import java.util.ArrayList;
1718
import java.util.Arrays;
1819
import java.util.EnumSet;
1920

@@ -28,7 +29,7 @@
2829
/**
2930
* The class for the Base Planner User Ids.
3031
*/
31-
public class BasePlannerUserIds implements IJsonBackedObject {
32+
public class BasePlannerUserIds extends ArrayList<String> implements IJsonBackedObject {
3233

3334
@SerializedName("@odata.type")
3435
@Expose(serialize = false)

0 commit comments

Comments
 (0)