forked from projectmgr/projectmanager-sdk-csharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
These patch notes summarize the changes from version 117.0.4438. Added 15 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}) * ProjectCustomer.CreateProjectCustomer (POST /api/data/projects/customers) * ProjectCustomer.UpdateProjectCustomer (PUT /api/data/projects/customers/{customerId}) * ProjectCustomer.DeleteProjectCustomer (DELETE /api/data/projects/customers/{customerId}) * 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: * 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`
- Loading branch information
1 parent
bbe7387
commit 8d42649
Showing
41 changed files
with
15,712 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.