diff --git a/pom.xml b/pom.xml index 469c568..3496687 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.projectmanager projectmanagersdk - 96.0.2123 + 97.0.2178 ProjectManagerSDK Software development kit for the ProjectManager.com API. for Java diff --git a/src/main/java/com/projectmanager/ProjectManagerClient.java b/src/main/java/com/projectmanager/ProjectManagerClient.java index 41147fd..70dad02 100644 --- a/src/main/java/com/projectmanager/ProjectManagerClient.java +++ b/src/main/java/com/projectmanager/ProjectManagerClient.java @@ -9,7 +9,7 @@ * @author ProjectManager.com * * @copyright 2023-2023 ProjectManager.com, Inc. - * @version 96.0.2123 + * @version 97.0.2178 * @link https://github.com/projectmgr/projectmanager-sdk-java */ diff --git a/src/main/java/com/projectmanager/RestRequest.java b/src/main/java/com/projectmanager/RestRequest.java index 78b6fb1..1b74481 100644 --- a/src/main/java/com/projectmanager/RestRequest.java +++ b/src/main/java/com/projectmanager/RestRequest.java @@ -148,7 +148,7 @@ public void AddBody(Object body) { } request.addHeader("SdkName", "Java"); - request.addHeader("SdkVersion", "96.0.2123.0"); + request.addHeader("SdkVersion", "97.0.2178.0"); String applicationName = this.client.getAppName(); diff --git a/src/main/java/com/projectmanager/clients/TaskClient.java b/src/main/java/com/projectmanager/clients/TaskClient.java index cea6935..f817ba2 100644 --- a/src/main/java/com/projectmanager/clients/TaskClient.java +++ b/src/main/java/com/projectmanager/clients/TaskClient.java @@ -172,4 +172,47 @@ public TaskClient(@NotNull ProjectManagerClient client) { if (body != null) { r.AddBody(body); } return r.Call(new TypeToken>() {}.getType()); } + + /** + * Adds a task parent relationship + * + * @param taskId The task that will become the child + * @param parentTaskId The parent task + * @return A {@link com.projectmanager.AstroResult} containing the results + */ + public @NotNull AstroResult addParentTask(@NotNull String taskId, @NotNull String parentTaskId) + { + RestRequest r = new RestRequest(this.client, "POST", "/api/data/tasks/{taskId}/parent/{parentTaskId}"); + r.AddPath("{taskId}", taskId == null ? "" : taskId.toString()); + r.AddPath("{parentTaskId}", parentTaskId == null ? "" : parentTaskId.toString()); + return r.Call(new TypeToken>() {}.getType()); + } + + /** + * Updates a task parent relationship + * + * @param taskId The task that will become the child + * @param parentTaskId The parent task + * @return A {@link com.projectmanager.AstroResult} containing the results + */ + public @NotNull AstroResult updateParentTask(@NotNull String taskId, @NotNull String parentTaskId) + { + RestRequest r = new RestRequest(this.client, "PUT", "/api/data/tasks/{taskId}/parent/{parentTaskId}"); + r.AddPath("{taskId}", taskId == null ? "" : taskId.toString()); + r.AddPath("{parentTaskId}", parentTaskId == null ? "" : parentTaskId.toString()); + return r.Call(new TypeToken>() {}.getType()); + } + + /** + * Removes a task parent relationship completely + * + * @param taskId The child task + * @return A {@link com.projectmanager.AstroResult} containing the results + */ + public @NotNull AstroResult removeParentTask(@NotNull String taskId) + { + RestRequest r = new RestRequest(this.client, "DELETE", "/api/data/tasks/{taskId}/parent"); + r.AddPath("{taskId}", taskId == null ? "" : taskId.toString()); + return r.Call(new TypeToken>() {}.getType()); + } } diff --git a/src/main/java/com/projectmanager/models/ProjectCreateDto.java b/src/main/java/com/projectmanager/models/ProjectCreateDto.java index 44aa614..dbacfc8 100644 --- a/src/main/java/com/projectmanager/models/ProjectCreateDto.java +++ b/src/main/java/com/projectmanager/models/ProjectCreateDto.java @@ -22,6 +22,9 @@ * A Project is a collection of Tasks that contributes towards a goal. Within a Project, Tasks * represent individual items of work that team members must complete. The sum total of Tasks * within a Project represents the work to be completed for that Project. + * + * Fields that cannot be selected during a CreateProject API call are not visible on this + * data model. */ public class ProjectCreateDto { @@ -225,23 +228,27 @@ public class ProjectCreateDto */ public void setTemplate(@NotNull Boolean value) { this.template = value; } /** - * The Template that this project should be created from. + * When creating a Project, you can optionally specify a Template to use to construct + * the Project using a collection of pre-designed Tasks. * - * Specifying a TemplateId will copy default settings for Tasks. + * Specifying a value in the TemplateId field will copy default settings for Tasks from + * your template Project into the newly created Project. * - * NOTE: This does not support custom templates - TemplateId has to be a reference - * to a static non-Custom template. + * This field does not support custom templates. You must choose from a list of + * ProjectManager-supplied templates. * * @return The field templateId */ public @Nullable String getTemplateId() { return this.templateId; } /** - * The Template that this project should be created from. + * When creating a Project, you can optionally specify a Template to use to construct + * the Project using a collection of pre-designed Tasks. * - * Specifying a TemplateId will copy default settings for Tasks. + * Specifying a value in the TemplateId field will copy default settings for Tasks from + * your template Project into the newly created Project. * - * NOTE: This does not support custom templates - TemplateId has to be a reference - * to a static non-Custom template. + * This field does not support custom templates. You must choose from a list of + * ProjectManager-supplied templates. * * @param value The new value for templateId */ diff --git a/src/main/java/com/projectmanager/models/ProjectDto.java b/src/main/java/com/projectmanager/models/ProjectDto.java index 4fc5efb..a970e68 100644 --- a/src/main/java/com/projectmanager/models/ProjectDto.java +++ b/src/main/java/com/projectmanager/models/ProjectDto.java @@ -35,6 +35,10 @@ public class ProjectDto private @Nullable String startDate; private @Nullable String endDate; private @Nullable String targetDate; + private @Nullable String plannedStartDate; + private @Nullable String plannedFinishDate; + private @Nullable String actualStartDate; + private @Nullable String actualFinishDate; private @Nullable ProjectPriorityDto priority; private @Nullable ProjectChargeCodeDto chargeCode; private @Nullable ProjectManagerDto manager; @@ -49,13 +53,15 @@ public class ProjectDto private @Nullable ProjectMemberDto[] members; /** - * The unique identifier of the Project. + * The unique identifier of the Project. This value is set by the system and cannot + * be set with a CreateProject or changed with an UpdateProject call. * * @return The field id */ public @NotNull String getId() { return this.id; } /** - * The unique identifier of the Project. + * The unique identifier of the Project. This value is set by the system and cannot + * be set with a CreateProject or changed with an UpdateProject call. * * @param value The new value for id */ @@ -202,6 +208,66 @@ public class ProjectDto * @param value The new value for targetDate */ public void setTargetDate(@Nullable String value) { this.targetDate = value; } + /** + * The planned start date for this Project. This is calculated based + * off of the earliest task start date + * + * @return The field plannedStartDate + */ + public @Nullable String getPlannedStartDate() { return this.plannedStartDate; } + /** + * The planned start date for this Project. This is calculated based + * off of the earliest task start date + * + * @param value The new value for plannedStartDate + */ + public void setPlannedStartDate(@Nullable String value) { this.plannedStartDate = value; } + /** + * The planned start date for this Project. This is calculated based + * off of the latest task finish date + * + * @return The field plannedFinishDate + */ + public @Nullable String getPlannedFinishDate() { return this.plannedFinishDate; } + /** + * The planned start date for this Project. This is calculated based + * off of the latest task finish date + * + * @param value The new value for plannedFinishDate + */ + public void setPlannedFinishDate(@Nullable String value) { this.plannedFinishDate = value; } + /** + * The actual start date for this Project. This is calculated based + * on the earliest task actual start date, or null if no projects have + * been started + * + * @return The field actualStartDate + */ + public @Nullable String getActualStartDate() { return this.actualStartDate; } + /** + * The actual start date for this Project. This is calculated based + * on the earliest task actual start date, or null if no projects have + * been started + * + * @param value The new value for actualStartDate + */ + public void setActualStartDate(@Nullable String value) { this.actualStartDate = value; } + /** + * The actual finish date for this Project. This is calculated based + * on the latest task actual finish date, or null if no projects have + * been finished + * + * @return The field actualFinishDate + */ + public @Nullable String getActualFinishDate() { return this.actualFinishDate; } + /** + * The actual finish date for this Project. This is calculated based + * on the latest task actual finish date, or null if no projects have + * been finished + * + * @param value The new value for actualFinishDate + */ + public void setActualFinishDate(@Nullable String value) { this.actualFinishDate = value; } /** * The ProjectPriority level of this Project, if defined. * @@ -299,24 +365,36 @@ public class ProjectDto /** * The timestamp in UTC when the Project was most recently modified. * + * This field is automatically determined by the system when this Project is modified + * and cannot be directly changed by the user. + * * @return The field modifyDate */ public @NotNull String getModifyDate() { return this.modifyDate; } /** * The timestamp in UTC when the Project was most recently modified. * + * This field is automatically determined by the system when this Project is modified + * and cannot be directly changed by the user. + * * @param value The new value for modifyDate */ public void setModifyDate(@NotNull String value) { this.modifyDate = value; } /** * The timestamp in UTC when the Project was created. * + * This field is automatically determined by the system when this Project is created + * and cannot be changed by the user. + * * @return The field createDate */ public @NotNull String getCreateDate() { return this.createDate; } /** * The timestamp in UTC when the Project was created. * + * This field is automatically determined by the system when this Project is created + * and cannot be changed by the user. + * * @param value The new value for createDate */ public void setCreateDate(@NotNull String value) { this.createDate = value; } diff --git a/src/main/java/com/projectmanager/models/ProjectUpdateDto.java b/src/main/java/com/projectmanager/models/ProjectUpdateDto.java index 65fb27c..59f67fa 100644 --- a/src/main/java/com/projectmanager/models/ProjectUpdateDto.java +++ b/src/main/java/com/projectmanager/models/ProjectUpdateDto.java @@ -22,6 +22,9 @@ * A Project is a collection of Tasks that contributes towards a goal. Within a Project, Tasks * represent individual items of work that team members must complete. The sum total of Tasks * within a Project represents the work to be completed for that Project. + * + * Fields that cannot be modified during an UpdateProject call are not visible on this data + * model. */ public class ProjectUpdateDto { diff --git a/src/main/java/com/projectmanager/models/TaskDetailsDto.java b/src/main/java/com/projectmanager/models/TaskDetailsDto.java index 9799e1e..f879d27 100644 --- a/src/main/java/com/projectmanager/models/TaskDetailsDto.java +++ b/src/main/java/com/projectmanager/models/TaskDetailsDto.java @@ -35,7 +35,7 @@ public class TaskDetailsDto private @Nullable String description; private @Nullable TaskStatusDto status; private @NotNull Integer priorityId; - private @NotNull String plannedStartDate; + private @Nullable String plannedStartDate; private @Nullable String plannedFinishDate; private @Nullable String actualStartDate; private @Nullable String actualFinishDate; @@ -174,13 +174,13 @@ public class TaskDetailsDto * * @return The field plannedStartDate */ - public @NotNull String getPlannedStartDate() { return this.plannedStartDate; } + public @Nullable String getPlannedStartDate() { return this.plannedStartDate; } /** * The date when work on this Task is planned to begin. * * @param value The new value for plannedStartDate */ - public void setPlannedStartDate(@NotNull String value) { this.plannedStartDate = value; } + public void setPlannedStartDate(@Nullable String value) { this.plannedStartDate = value; } /** * The date when work on this Task is expected to complete. * diff --git a/src/main/java/com/projectmanager/models/TaskDto.java b/src/main/java/com/projectmanager/models/TaskDto.java index 764600c..b7d6f7c 100644 --- a/src/main/java/com/projectmanager/models/TaskDto.java +++ b/src/main/java/com/projectmanager/models/TaskDto.java @@ -27,11 +27,14 @@ public class TaskDto { private @NotNull String id; private @Nullable TaskProjectDto project; + private @Nullable TaskTagDto[] tags; private @NotNull String projectId; private @Nullable TaskAssigneeDto[] assignees; + private @Nullable TaskTodoDto[] todos; private @Nullable String shortId; private @Nullable String name; private @Nullable String description; + private @Nullable TaskStatusDto status; private @NotNull String plannedStartDate; private @Nullable String plannedFinishDate; private @Nullable String actualStartDate; @@ -45,6 +48,8 @@ public class TaskDto private @Nullable String color; private @Nullable Double actualCost; private @Nullable Double plannedCost; + private @Nullable Integer plannedDuration; + private @Nullable Integer plannedEffort; /** * The unique identifier of this Task. @@ -70,6 +75,18 @@ public class TaskDto * @param value The new value for project */ public void setProject(@Nullable TaskProjectDto value) { this.project = value; } + /** + * The TaskTags that apply to this Task. + * + * @return The field tags + */ + public @Nullable TaskTagDto[] getTags() { return this.tags; } + /** + * The TaskTags that apply to this Task. + * + * @param value The new value for tags + */ + public void setTags(@Nullable TaskTagDto[] value) { this.tags = value; } /** * The unique identifier of the Project to which this Task belongs. * @@ -94,6 +111,18 @@ public class TaskDto * @param value The new value for assignees */ public void setAssignees(@Nullable TaskAssigneeDto[] value) { this.assignees = value; } + /** + * A list of TaskTodo items, which are sub-tasks within this Task. + * + * @return The field todos + */ + public @Nullable TaskTodoDto[] getTodos() { return this.todos; } + /** + * A list of TaskTodo items, which are sub-tasks within this Task. + * + * @param value The new value for todos + */ + public void setTodos(@Nullable TaskTodoDto[] value) { this.todos = value; } /** * A short ID that can be used to refer to this Task. This short ID is * guaranteed to be unique within your Workspace. @@ -132,6 +161,18 @@ public class TaskDto * @param value The new value for description */ public void setDescription(@Nullable String value) { this.description = value; } + /** + * The TaskStatus assigned to this Task. + * + * @return The field status + */ + public @Nullable TaskStatusDto getStatus() { return this.status; } + /** + * The TaskStatus assigned to this Task. + * + * @param value The new value for status + */ + public void setStatus(@Nullable TaskStatusDto value) { this.status = value; } /** * The date when work on this Task is planned to begin. * @@ -400,4 +441,28 @@ public class TaskDto * @param value The new value for plannedCost */ public void setPlannedCost(@Nullable Double value) { this.plannedCost = value; } + /** + * The planned duration (in minutes) for this Task. + * + * @return The field plannedDuration + */ + public @Nullable Integer getPlannedDuration() { return this.plannedDuration; } + /** + * The planned duration (in minutes) for this Task. + * + * @param value The new value for plannedDuration + */ + public void setPlannedDuration(@Nullable Integer value) { this.plannedDuration = value; } + /** + * The planned effort (in minutes) for this Task. + * + * @return The field plannedEffort + */ + public @Nullable Integer getPlannedEffort() { return this.plannedEffort; } + /** + * The planned effort (in minutes) for this Task. + * + * @param value The new value for plannedEffort + */ + public void setPlannedEffort(@Nullable Integer value) { this.plannedEffort = value; } };