Skip to content

Commit

Permalink
# Patch notes for 121.0.4887 (#48)
Browse files Browse the repository at this point in the history
These patch notes summarize the changes from version 120.0.4689.

Added 7 new APIs:
* Discussion.LikeAComment (POST /api/data/comments/{commentId}/like)
* Discussion.RemovesAThumbsupFromAComment (DELETE /api/data/comments/{commentId}/like)
* Discussion.RemoveAComment (DELETE /api/data/comments/{commentId})
* TaskTodo.GetTodosForATask (GET /api/data/tasks/{taskId}/todos)
* TaskTodo.CreateATodoForATask (POST /api/data/tasks/{taskId}/todos)
* TaskTodo.UpdateATodo (PUT /api/data/tasks/todos/{todoId})
* TaskTodo.DeleteATodo (DELETE /api/data/tasks/todos/{todoId})

Changes to existing APIs:
* Notification.RetrieveNotifications added query parameter `senderId`
* Notification.RetrieveNotifications added query parameter `notificationTypes`
* Notification.RetrieveNotifications added query parameter `asFlatList`

Changes to data models:
* ResourceDto: Added new field `countryName`
* TaskCreateDto: Added new field `isLocked`
* TaskCreateDto: Added new field `isMilestone`
* TaskUpdateDto: Added new field `isLocked`
* TaskUpdateDto: Added new field `isMilestone`
* TimesheetCreateRequestDto: Added new field `minutes`
* TimesheetDto: Added new field `minutes`
* TimesheetResponseDto: Added new field `minutes`
* TimesheetUpdateRequestDto: Added new field `minutes`

Co-authored-by: tspence <[email protected]>
  • Loading branch information
github-actions[bot] and tspence authored Oct 30, 2024
1 parent 25302dc commit 73551bb
Show file tree
Hide file tree
Showing 19 changed files with 14,953 additions and 22 deletions.
39 changes: 24 additions & 15 deletions ProjectManagerClient.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package >
<metadata>
<id>ProjectManager.SDK</id>
<version>120.0.4689</version>
<version>121.0.4887</version>
<title>ProjectManager.SDK</title>
<authors>ProjectManager.com</authors>
<owners>ProjectManager.com, Inc.</owners>
Expand All @@ -14,25 +14,34 @@
<readme>docs/README.md</readme>
<summary>ProjectManager API for DotNet</summary>
<releaseNotes>
# Patch notes for 120.0.4689
# Patch notes for 121.0.4887

These patch notes summarize the changes from version 117.0.4438.
These patch notes summarize the changes from version 120.0.4689.

Added 5 new APIs:
* ProjectVersion.RetrieveProjectVersions (GET /api/data/projects/{projectId}/versions)
* ProjectVersion.DownloadMSProjectXml (GET /api/data/projects/{projectChangeId}/version/download)
* ProjectVersion.RestoreProjectVersion (POST /api/data/projects/{projectId}/version/{version}/restore)
* ProjectVersion.CopyProjectVersion (POST /api/data/projects/{projectId}/version/{version}/copy)
* Risk.CreateRiskExport (POST /api/data/projects/{projectId}/risks/export)
Added 7 new APIs:
* Discussion.LikeAComment (POST /api/data/comments/{commentId}/like)
* Discussion.RemovesAThumbsupFromAComment (DELETE /api/data/comments/{commentId}/like)
* Discussion.RemoveAComment (DELETE /api/data/comments/{commentId})
* TaskTodo.GetTodosForATask (GET /api/data/tasks/{taskId}/todos)
* TaskTodo.CreateATodoForATask (POST /api/data/tasks/{taskId}/todos)
* TaskTodo.UpdateATodo (PUT /api/data/tasks/todos/{todoId})
* TaskTodo.DeleteATodo (DELETE /api/data/tasks/todos/{todoId})

Renamed 1 old APIs:
* Renamed 'TaskMetadata.GetTasksByProjectIDAndForeignKeyID' to 'TaskMetadata.TaskMetadataSearch'
Changes to existing APIs:
* Notification.RetrieveNotifications added query parameter `senderId`
* Notification.RetrieveNotifications added query parameter `notificationTypes`
* Notification.RetrieveNotifications added query parameter `asFlatList`

Changes to data models:
* ResourceDto: Added new field `initials`
* ResourceDto: Added new field `avatarUrl`
* TaskDto: Added new field `isLocked`
* TaskDto: Added new field `isMilestone`
* ResourceDto: Added new field `countryName`
* TaskCreateDto: Added new field `isLocked`
* TaskCreateDto: Added new field `isMilestone`
* TaskUpdateDto: Added new field `isLocked`
* TaskUpdateDto: Added new field `isMilestone`
* TimesheetCreateRequestDto: Added new field `minutes`
* TimesheetDto: Added new field `minutes`
* TimesheetResponseDto: Added new field `minutes`
* TimesheetUpdateRequestDto: Added new field `minutes`


</releaseNotes>
Expand Down
30 changes: 30 additions & 0 deletions src/Clients/DiscussionClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,35 @@ public async Task<AstroResult<DiscussionCommentCreateResponseDto>> CreateTaskCom
var url = $"/api/data/tasks/{taskId}/comments";
return await _client.RequestWithBody<DiscussionCommentCreateResponseDto>(HttpMethod.Post, url, null, body);
}

/// <summary>
/// Puts a thumbsup on a comment
/// </summary>
/// <param name="commentId">the id of the comment</param>
public async Task<AstroResult<string>> LikeAComment(Guid commentId)
{
var url = $"/api/data/comments/{commentId}/like";
return await _client.Request<string>(HttpMethod.Post, url, null);
}

/// <summary>
/// Unlike a comment that was previously liked
/// </summary>
/// <param name="commentId">the id of the comment</param>
public async Task<AstroResult<string>> RemovesAThumbsupFromAComment(Guid commentId)
{
var url = $"/api/data/comments/{commentId}/like";
return await _client.Request<string>(HttpMethod.Delete, url, null);
}

/// <summary>
/// Removes a comment by it&#39;s id
/// </summary>
/// <param name="commentId">Remove a comment</param>
public async Task<AstroResult<string>> RemoveAComment(Guid commentId)
{
var url = $"/api/data/comments/{commentId}";
return await _client.Request<string>(HttpMethod.Delete, url, null);
}
}
}
8 changes: 7 additions & 1 deletion src/Clients/NotificationClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,17 @@ public NotificationClient(ProjectManagerClient client)
/// using the parameter `lastId` of the oldest notification from each batch to fetch the next 500 notifications.
/// </summary>
/// <param name="lastId">To continue loading more notifications in a series of requests, provide the ID of the oldest notification from the currently loaded batch as the `lastId` parameter</param>
public async Task<AstroResult<NotificationResponseDto>> RetrieveNotifications(Guid? lastId = null)
/// <param name="senderId">Filter the notifications to only those sent by the user with the specified ID</param>
/// <param name="notificationTypes">Specifies the types of notifications to return. If not provided, all notifications will be returned.</param>
/// <param name="asFlatList">If set to true all notifications will be returned as a flat list, otherwise they will be grouped by parent in the same manner as displayed in the UI.</param>
public async Task<AstroResult<NotificationResponseDto>> RetrieveNotifications(Guid? lastId = null, Guid? senderId = null, string[] notificationTypes = null, bool? asFlatList = null)
{
var url = $"/api/data/notifications";
var options = new Dictionary<string, object>();
if (lastId != null) { options["lastId"] = lastId; }
if (senderId != null) { options["senderId"] = senderId; }
if (notificationTypes != null) { options["notificationTypes"] = notificationTypes; }
if (asFlatList != null) { options["asFlatList"] = asFlatList; }
return await _client.Request<NotificationResponseDto>(HttpMethod.Get, url, options);
}

Expand Down
83 changes: 83 additions & 0 deletions src/Clients/TaskTodoClient.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
/***
* ProjectManager API for C#
*
* (c) 2023-2024 ProjectManager.com, Inc.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @author ProjectManager.com <[email protected]>
* @copyright 2023-2024 ProjectManager.com, Inc.
* @link https://github.com/projectmgr/projectmanager-sdk-csharp
*/



using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Threading.Tasks;
using ProjectManager.SDK.Interfaces;
using ProjectManager.SDK.Models;


namespace ProjectManager.SDK.Clients
{
/// <summary>
/// API methods related to TaskTodo
/// </summary>
public class TaskTodoClient : ITaskTodoClient
{
private readonly ProjectManagerClient _client;

/// <summary>
/// Constructor
/// </summary>
public TaskTodoClient(ProjectManagerClient client)
{
_client = client;
}

/// <summary>
/// Retrieve a list of todos for a task
/// </summary>
/// <param name="taskId">the id of the task</param>
public async Task<AstroResult<TaskTodoDto[]>> GetTodosForATask(Guid taskId)
{
var url = $"/api/data/tasks/{taskId}/todos";
return await _client.Request<TaskTodoDto[]>(HttpMethod.Get, url, null);
}

/// <summary>
/// Create a todo for a task
/// </summary>
/// <param name="taskId">the id of the task</param>
/// <param name="body">the data for creating a todo</param>
public async Task<AstroResult<TaskTodoDto>> CreateATodoForATask(Guid taskId, TaskTodoCreateDto body)
{
var url = $"/api/data/tasks/{taskId}/todos";
return await _client.RequestWithBody<TaskTodoDto>(HttpMethod.Post, url, null, body);
}

/// <summary>
/// Update a todo for a task
/// </summary>
/// <param name="todoId">the id of the task</param>
/// <param name="body">the data for updating a todo</param>
public async Task<AstroResult<TaskTodoDto>> UpdateATodo(Guid todoId, TaskTodoUpdateDto body)
{
var url = $"/api/data/tasks/todos/{todoId}";
return await _client.RequestWithBody<TaskTodoDto>(HttpMethod.Put, url, null, body);
}

/// <summary>
/// Remove a todo
/// </summary>
/// <param name="todoId">the id of the todo</param>
public async Task<AstroResult<string>> DeleteATodo(Guid todoId)
{
var url = $"/api/data/tasks/todos/{todoId}";
return await _client.Request<string>(HttpMethod.Delete, url, null);
}
}
}
6 changes: 5 additions & 1 deletion src/IProjectManagerClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* @author ProjectManager.com <[email protected]>
*
* @copyright 2023-2024 ProjectManager.com, Inc.
* @version 120.0.4689
* @version 121.0.4887
* @link https://github.com/projectmgr/projectmanager-sdk-csharp
*/

Expand Down Expand Up @@ -172,6 +172,10 @@ public interface IProjectManagerClient
/// </summary>
ITaskTagClient TaskTag { get; }
/// <summary>
/// API methods related to TaskTodo
/// </summary>
ITaskTodoClient TaskTodo { get; }
/// <summary>
/// API methods related to Teams
/// </summary>
ITeamsClient Teams { get; }
Expand Down
18 changes: 18 additions & 0 deletions src/Interfaces/IDiscussionClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,23 @@ public interface IDiscussionClient
/// <param name="taskId">The unique ID number of the task being commented upon</param>
/// <param name="body">The Markdown-formatted text of the comment</param>
Task<AstroResult<DiscussionCommentCreateResponseDto>> CreateTaskComments(Guid taskId, DiscussionCommentCreateDto body);

/// <summary>
/// Puts a thumbsup on a comment
/// </summary>
/// <param name="commentId">the id of the comment</param>
Task<AstroResult<string>> LikeAComment(Guid commentId);

/// <summary>
/// Unlike a comment that was previously liked
/// </summary>
/// <param name="commentId">the id of the comment</param>
Task<AstroResult<string>> RemovesAThumbsupFromAComment(Guid commentId);

/// <summary>
/// Removes a comment by it&#39;s id
/// </summary>
/// <param name="commentId">Remove a comment</param>
Task<AstroResult<string>> RemoveAComment(Guid commentId);
}
}
5 changes: 4 additions & 1 deletion src/Interfaces/INotificationClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ public interface INotificationClient
/// using the parameter `lastId` of the oldest notification from each batch to fetch the next 500 notifications.
/// </summary>
/// <param name="lastId">To continue loading more notifications in a series of requests, provide the ID of the oldest notification from the currently loaded batch as the `lastId` parameter</param>
Task<AstroResult<NotificationResponseDto>> RetrieveNotifications(Guid? lastId = null);
/// <param name="senderId">Filter the notifications to only those sent by the user with the specified ID</param>
/// <param name="notificationTypes">Specifies the types of notifications to return. If not provided, all notifications will be returned.</param>
/// <param name="asFlatList">If set to true all notifications will be returned as a flat list, otherwise they will be grouped by parent in the same manner as displayed in the UI.</param>
Task<AstroResult<NotificationResponseDto>> RetrieveNotifications(Guid? lastId = null, Guid? senderId = null, string[] notificationTypes = null, bool? asFlatList = null);

/// <summary>
/// Retrieve the total count of pending notifications for the current user.
Expand Down
56 changes: 56 additions & 0 deletions src/Interfaces/ITaskTodoClient.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/***
* ProjectManager API for C#
*
* (c) 2023-2024 ProjectManager.com, Inc.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @author ProjectManager.com <[email protected]>
* @copyright 2023-2024 ProjectManager.com, Inc.
* @link https://github.com/projectmgr/projectmanager-sdk-csharp
*/



using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using ProjectManager.SDK.Models;


namespace ProjectManager.SDK.Interfaces
{
/// <summary>
/// API methods related to TaskTodo
/// </summary>
public interface ITaskTodoClient
{

/// <summary>
/// Retrieve a list of todos for a task
/// </summary>
/// <param name="taskId">the id of the task</param>
Task<AstroResult<TaskTodoDto[]>> GetTodosForATask(Guid taskId);

/// <summary>
/// Create a todo for a task
/// </summary>
/// <param name="taskId">the id of the task</param>
/// <param name="body">the data for creating a todo</param>
Task<AstroResult<TaskTodoDto>> CreateATodoForATask(Guid taskId, TaskTodoCreateDto body);

/// <summary>
/// Update a todo for a task
/// </summary>
/// <param name="todoId">the id of the task</param>
/// <param name="body">the data for updating a todo</param>
Task<AstroResult<TaskTodoDto>> UpdateATodo(Guid todoId, TaskTodoUpdateDto body);

/// <summary>
/// Remove a todo
/// </summary>
/// <param name="todoId">the id of the todo</param>
Task<AstroResult<string>> DeleteATodo(Guid todoId);
}
}
5 changes: 5 additions & 0 deletions src/Models/ResourceDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ public class ResourceDto : ApiModel
/// </summary>
public string Country { get; set; }

/// <summary>
/// Returns the name of the country
/// </summary>
public string CountryName { get; set; }

/// <summary>
/// Free-form text notes about this Resource. You may use this field to store extra
/// information about the Resource.
Expand Down
16 changes: 16 additions & 0 deletions src/Models/TaskCreateDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,5 +111,21 @@ public class TaskCreateDto : ApiModel
/// LightGrey, LightPurple, LightYellow, Magenta, Mauve, Navy, Orange, Purple, Red.
/// </summary>
public string Theme { get; set; }

/// <summary>
/// Unlocked tasks can be adjusted by changes to their dependencies, resource leveling, or other factors.
///
/// All tasks are unlocked by default.
///
/// If a task is set to `IsLocked` = `true`, the dates and assigned resources are locked for this task and will not
/// be automatically changed by any process.
/// </summary>
public bool? IsLocked { get; set; }

/// <summary>
/// True if this task is a milestone. Milestones represent a specific point in time for the project. When a
/// milestone is locked, it represents a fixed time within the project that can be used to relate to other tasks.
/// </summary>
public bool? IsMilestone { get; set; }
}
}
39 changes: 39 additions & 0 deletions src/Models/TaskTodoCreateDto.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/***
* ProjectManager API for C#
*
* (c) 2023-2024 ProjectManager.com, Inc.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @author ProjectManager.com <[email protected]>
* @copyright 2023-2024 ProjectManager.com, Inc.
* @link https://github.com/projectmgr/projectmanager-sdk-csharp
*/



#pragma warning disable CS8618

using System;

namespace ProjectManager.SDK.Models
{

/// <summary>
/// The properties for creating a TaskTodo.
/// </summary>
public class TaskTodoCreateDto : ApiModel
{

/// <summary>
/// The full description of this TaskTodo.
/// </summary>
public string Text { get; set; }

/// <summary>
/// True if this TaskTodo is complete.
/// </summary>
public bool? Complete { get; set; }
}
}
Loading

0 comments on commit 73551bb

Please sign in to comment.