use of com.microsoft.graph.models.PlannerTask in project msgraph-beta-sdk-java by microsoftgraph.
the class PlannerTests method testUpdateTaskCategories.
@Test
public void testUpdateTaskCategories() {
PlannerTask task = new PlannerTask();
JsonObject data = new JsonObject();
data.add("category1", new JsonPrimitive(false));
data.add("category2", new JsonPrimitive(true));
data.add("category3", new JsonPrimitive(false));
data.add("category4", new JsonPrimitive(false));
data.add("category5", new JsonPrimitive(false));
data.add("category6", new JsonPrimitive(false));
AdditionalDataManager dataManager = task.additionalDataManager();
dataManager.put("appliedCategories", data);
PlannerTask newTask = prb.tasks(planTask.id).buildRequest().get();
PlannerTaskRequest req = prb.tasks(planTask.id).buildRequest();
req.addHeader("If-Match", newTask.additionalDataManager().get("@odata.etag").getAsString());
req.addHeader("If-None-Match", newTask.additionalDataManager().get("@odata.etag").getAsString());
req.addHeader("Prefer", "return=representation");
PlannerTask updatedTask = req.patch(task);
JsonElement appliedCategories = updatedTask.additionalDataManager().get("appliedCategories");
assertNotNull(appliedCategories);
}
use of com.microsoft.graph.models.PlannerTask in project msgraph-beta-sdk-java by microsoftgraph.
the class PlannerTests method testDeleteTask.
@Test
public void testDeleteTask() {
PlannerTask newTask = new PlannerTask();
newTask.title = "Delete Me";
newTask.planId = planId;
newTask.bucketId = planBucket.id;
PlannerTask task = prb.tasks().buildRequest().post(newTask);
PlannerTaskRequest req = testBase.graphClient.planner().tasks(task.id).buildRequest();
req.addHeader("If-Match", task.additionalDataManager().get("@odata.etag").getAsString());
req.delete();
}
Aggregations