Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 121.0.4903 #6

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 38 additions & 7 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>117.0.4438</version>
<version>121.0.4903</version>
<title>ProjectManager.SDK</title>
<authors>ProjectManager.com</authors>
<owners>ProjectManager.com, Inc.</owners>
Expand All @@ -14,15 +14,46 @@
<readme>docs/README.md</readme>
<summary>ProjectManager API for DotNet</summary>
<releaseNotes>
# Patch notes for 117.0.4438
# Patch notes for 121.0.4903

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

Added 12 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})
* 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)
* 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:
* ResourceCreateDto: Added new field `colorName`
* ResourceDto: Added new field `colorName`
* ResourceDto: Added new field `color`
* ResourceUpdateDto: Added new field `colorName`
* ResourceDto: Added new field `initials`
* ResourceDto: Added new field `countryName`
* ResourceDto: Added new field `avatarUrl`
* TaskCreateDto: Added new field `isLocked`
* TaskCreateDto: Added new field `isMilestone`
* TaskDto: Added new field `isLocked`
* TaskDto: 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);
}
}
}
14 changes: 10 additions & 4 deletions 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 Expand Up @@ -103,7 +109,7 @@ public async Task<AstroResult<string>> DeleteAllNotifications()
/// workspace. Notifications are ephemeral and may be deleted when they are no longer needed. When a user has more
/// than 1,000 pending notifications some old notifications will be deleted automatically.
/// </summary>
/// <param name="id"></param>
/// <param name="id">The unique identifier of the notification to mark read</param>
public async Task<AstroResult<NotificationTimestampDto>> MarkNotificationRead(Guid id)
{
var url = $"/api/data/notifications/{id}/markread";
Expand All @@ -130,7 +136,7 @@ public async Task<AstroResult<NotificationTimestampDto>> ReadAllNotifications()
/// workspace. Notifications are ephemeral and may be deleted when they are no longer needed. When a user has more
/// than 1,000 pending notifications some old notifications will be deleted automatically.
/// </summary>
/// <param name="id"></param>
/// <param name="id">The unique identifier of the notification to mark read</param>
public async Task<AstroResult<string>> DeleteNotification(Guid id)
{
var url = $"/api/data/notifications/delete/{id}";
Expand All @@ -144,7 +150,7 @@ public async Task<AstroResult<string>> DeleteNotification(Guid id)
/// workspace. Notifications are ephemeral and may be deleted when they are no longer needed. When a user has more
/// than 1,000 pending notifications some old notifications will be deleted automatically.
/// </summary>
/// <param name="id"></param>
/// <param name="id">The unique identifier of the notification to mark read</param>
public async Task<AstroResult<string>> MarkNotificationUnread(Guid id)
{
var url = $"/api/data/notifications/{id}/markunread";
Expand Down
89 changes: 89 additions & 0 deletions src/Clients/ProjectVersionClient.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
/***
* 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 ProjectVersion
/// </summary>
public class ProjectVersionClient : IProjectVersionClient
{
private readonly ProjectManagerClient _client;

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

/// <summary>
/// Returns projects versions including version, user who made changes
/// </summary>
/// <param name="projectId">The unique identifier of the Project</param>
public async Task<AstroResult<ProjectVersionDto[]>> RetrieveProjectVersions(Guid projectId)
{
var url = $"/api/data/projects/{projectId}/versions";
return await _client.Request<ProjectVersionDto[]>(HttpMethod.Get, url, null);
}

/// <summary>
/// Exports and returns project version as an MS Project XML attachment
/// </summary>
/// <param name="projectChangeId">Project change Guid</param>
public async Task<AstroResult<byte[]>> DownloadMSProjectXml(Guid projectChangeId)
{
var url = $"/api/data/projects/{projectChangeId}/version/download";
return await _client.Request<byte[]>(HttpMethod.Get, url, null);
}

/// <summary>
/// Restores a Project to the state it was in at a specific Version in time.
///
/// If successful, all changes made to the Project since this Version will be undone and the Project will
/// return to its former state.
/// </summary>
/// <param name="projectId">The unique identifier of the Project to restore</param>
/// <param name="version">The version number to restore to</param>
public async Task<AstroResult<string>> RestoreProjectVersion(Guid projectId, int version)
{
var url = $"/api/data/projects/{projectId}/version/{version}/restore";
return await _client.Request<string>(HttpMethod.Post, url, null);
}

/// <summary>
/// Create a Copy of a Project as of a specific Version, optionally moving it to a new Timezone.
/// </summary>
/// <param name="projectId">The unique identifier of the Project to copy</param>
/// <param name="version">The version number of the Project to copy</param>
/// <param name="timezoneOffset">If specified, sets the default timezone of the newly copied Project to this specified timezone</param>
public async Task<AstroResult<string>> CopyProjectVersion(Guid projectId, int version, int? timezoneOffset = null)
{
var url = $"/api/data/projects/{projectId}/version/{version}/copy";
var options = new Dictionary<string, object>();
if (timezoneOffset != null) { options["timezoneOffset"] = timezoneOffset; }
return await _client.Request<string>(HttpMethod.Post, url, options);
}
}
}
54 changes: 54 additions & 0 deletions src/Clients/RiskClient.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/***
* 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 Risk
/// </summary>
public class RiskClient : IRiskClient
{
private readonly ProjectManagerClient _client;

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

/// <summary>
/// Initiates a new Export action for Risks.
///
/// Returns the identifier of this Risk Export.
/// </summary>
/// <param name="projectId">The unique identifier of the Project for which to export Risks</param>
/// <param name="body">The settings to use for this export action</param>
public async Task<AstroResult<ExportDto>> CreateRiskExport(Guid projectId, RiskExportSettingsDto body)
{
var url = $"/api/data/projects/{projectId}/risks/export";
return await _client.RequestWithBody<ExportDto>(HttpMethod.Post, url, null, body);
}
}
}
8 changes: 7 additions & 1 deletion src/Clients/TaskMetadataClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,13 @@ public async Task<AstroResult<string>> AddMetadata(Guid taskId, TaskMetadataUpda
return await _client.RequestWithBody<string>(HttpMethod.Put, url, options, body);
}

public async Task<AstroResult<TaskMetadataSearchDto[]>> GetTasksByProjectIDAndForeignKeyID(Guid projectId, string foreignKey = null, bool? isSystem = null)
/// <summary>
/// Get tasks by project ID and foreign key ID
/// </summary>
/// <param name="foreignKey">Foreign Key ID</param>
/// <param name="projectId">Project ID</param>
/// <param name="isSystem">If metadata is for system or customer, isSystem = true is only of ProjectManager</param>
public async Task<AstroResult<TaskMetadataSearchDto[]>> TaskMetadataSearch(Guid projectId, string foreignKey = null, bool? isSystem = null)
{
var url = $"/api/data/projects/{projectId}/tasks/metadata";
var options = new Dictionary<string, object>();
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);
}
}
}
Loading