Skip to content

Commit

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

Added 3 new APIs:
* ProjectCustomer.CreateProjectCustomer (POST /api/data/projects/customers)
* ProjectCustomer.UpdateProjectCustomer (PUT /api/data/projects/customers/{customerId})
* ProjectCustomer.DeleteProjectCustomer (DELETE /api/data/projects/customers/{customerId})

Co-authored-by: tspence <[email protected]>
  • Loading branch information
github-actions[bot] and tspence authored Nov 18, 2024
1 parent 73551bb commit 5437374
Show file tree
Hide file tree
Showing 8 changed files with 14,912 additions and 30 deletions.
34 changes: 7 additions & 27 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>121.0.4887</version>
<version>122.0.214</version>
<title>ProjectManager.SDK</title>
<authors>ProjectManager.com</authors>
<owners>ProjectManager.com, Inc.</owners>
Expand All @@ -14,34 +14,14 @@
<readme>docs/README.md</readme>
<summary>ProjectManager API for DotNet</summary>
<releaseNotes>
# Patch notes for 121.0.4887
# Patch notes for 122.0.214

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

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`
Added 3 new APIs:
* ProjectCustomer.CreateProjectCustomer (POST /api/data/projects/customers)
* ProjectCustomer.UpdateProjectCustomer (PUT /api/data/projects/customers/{customerId})
* ProjectCustomer.DeleteProjectCustomer (DELETE /api/data/projects/customers/{customerId})


</releaseNotes>
Expand Down
31 changes: 31 additions & 0 deletions src/Clients/ProjectCustomerClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,36 @@ public async Task<AstroResult<ProjectCustomerDto[]>> RetrieveProjectCustomers()
var url = $"/api/data/projects/customers";
return await _client.Request<ProjectCustomerDto[]>(HttpMethod.Get, url, null);
}

/// <summary>
/// Create a project customer
/// </summary>
/// <param name="body">The data to create the customer</param>
public async Task<AstroResult<ProjectCustomerDto>> CreateProjectCustomer(ProjectCustomerCreateDto body)
{
var url = $"/api/data/projects/customers";
return await _client.RequestWithBody<ProjectCustomerDto>(HttpMethod.Post, url, null, body);
}

/// <summary>
/// Updates a project customer
/// </summary>
/// <param name="customerId">The id of the customer to update</param>
/// <param name="body">The data to update</param>
public async Task<AstroResult<ProjectCustomerDto>> UpdateProjectCustomer(Guid customerId, ProjectCustomerCreateDto body)
{
var url = $"/api/data/projects/customers/{customerId}";
return await _client.RequestWithBody<ProjectCustomerDto>(HttpMethod.Put, url, null, body);
}

/// <summary>
/// Delete a project customer. They will also be removed from any projects they were assigned too.
/// </summary>
/// <param name="customerId">The id of the customer to remove</param>
public async Task<AstroResult<string>> DeleteProjectCustomer(Guid customerId)
{
var url = $"/api/data/projects/customers/{customerId}";
return await _client.Request<string>(HttpMethod.Delete, url, null);
}
}
}
2 changes: 1 addition & 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 121.0.4887
* @version 122.0.214
* @link https://github.com/projectmgr/projectmanager-sdk-csharp
*/

Expand Down
19 changes: 19 additions & 0 deletions src/Interfaces/IProjectCustomerClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,24 @@ public interface IProjectCustomerClient
/// Workspace and are shared among Projects.
/// </summary>
Task<AstroResult<ProjectCustomerDto[]>> RetrieveProjectCustomers();

/// <summary>
/// Create a project customer
/// </summary>
/// <param name="body">The data to create the customer</param>
Task<AstroResult<ProjectCustomerDto>> CreateProjectCustomer(ProjectCustomerCreateDto body);

/// <summary>
/// Updates a project customer
/// </summary>
/// <param name="customerId">The id of the customer to update</param>
/// <param name="body">The data to update</param>
Task<AstroResult<ProjectCustomerDto>> UpdateProjectCustomer(Guid customerId, ProjectCustomerCreateDto body);

/// <summary>
/// Delete a project customer. They will also be removed from any projects they were assigned too.
/// </summary>
/// <param name="customerId">The id of the customer to remove</param>
Task<AstroResult<string>> DeleteProjectCustomer(Guid customerId);
}
}
36 changes: 36 additions & 0 deletions src/Models/ProjectCustomerCreateDto.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/***
* 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>
/// A ProjectCustomer is a code used to identify costs within your Projects. Each
/// ProjectCustomer has a name and a unique identifier. ChargeCodes are defined per
/// Workspace and are shared among Projects.
/// </summary>
public class ProjectCustomerCreateDto : ApiModel
{

/// <summary>
/// The name of this ProjectCustomer
/// </summary>
public string Name { get; set; }
}
}
2 changes: 2 additions & 0 deletions src/Models/ProjectUpdateDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ public class ProjectUpdateDto : ApiModel
/// <summary>
/// To assign this Project to a ProjectCustomer, set this to the unique identifier of the
/// ProjectCustomer.
///
/// If set to an empty guid the Project will be unassigned from the current ProjectCustomer.
/// </summary>
public Guid? CustomerId { get; set; }

Expand Down
4 changes: 2 additions & 2 deletions src/ProjectManagerClient.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 121.0.4887
* @version 122.0.214
* @link https://github.com/projectmgr/projectmanager-sdk-csharp
*/

Expand Down Expand Up @@ -39,7 +39,7 @@ public class ProjectManagerClient : IProjectManagerClient
/// <summary>
/// The version of the SDK
/// </summary>
public const string SdkVersion = "121.0.4887";
public const string SdkVersion = "122.0.214";

private readonly string _apiUrl;
private readonly HttpClient _client;
Expand Down
Loading

0 comments on commit 5437374

Please sign in to comment.