Skip to content

Commit 3073885

Browse files
[TASKSCLOUD-682] - Deployed new 22.12 version.
1 parent d1bb3fe commit 3073885

12 files changed

+323
-10
lines changed

Aspose.Tasks.Cloud.Sdk.Tests/Aspose.Tasks.Cloud.Sdk.Tests.csproj

+1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
<Compile Include="Reports\TestReport.cs" />
6363
<Compile Include="Resources\TestResources.cs" />
6464
<Compile Include="TaskLinks\TaskLinksTests.cs" />
65+
<Compile Include="Tasks\TestPrimaveraProperties.cs" />
6566
<Compile Include="Tasks\TestRecurringInfo.cs" />
6667
<Compile Include="Tasks\TestTasksExtendedAttributes.cs" />
6768
<Compile Include="Tasks\TestTasks.cs" />

Aspose.Tasks.Cloud.Sdk.Tests/DocumentProperties/TestDocumentProperties.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public async Task TestGetDocumentProperties()
4949
});
5050

5151
Assert.AreEqual((int)HttpStatusCode.OK, response.Code);
52-
Assert.AreEqual(52, response.Properties.List.Count);
52+
Assert.AreEqual(63, response.Properties.List.Count);
5353
Assert.AreEqual("Title", response.Properties.List[0].Name);
5454
Assert.AreEqual("Home Move", response.Properties.List[0].Value);
5555
}
@@ -96,7 +96,7 @@ public async Task TestEditDocumentProperty()
9696
});
9797

9898
Assert.AreEqual((int)HttpStatusCode.OK, response.Code);
99-
Assert.AreEqual(52, response.Properties.List.Count);
99+
Assert.AreEqual(63, response.Properties.List.Count);
100100
Assert.AreEqual("Title", response.Properties.List[0].Name);
101101
Assert.AreEqual("New title value", response.Properties.List[0].Value);
102102
}
@@ -125,7 +125,7 @@ public async Task TestEditDocumentPropertyViaPost()
125125
});
126126

127127
Assert.AreEqual((int)HttpStatusCode.OK, response.Code);
128-
Assert.AreEqual(52, response.Properties.List.Count);
128+
Assert.AreEqual(63, response.Properties.List.Count);
129129
Assert.AreEqual("Title", response.Properties.List[0].Name);
130130
Assert.AreEqual("New title value", response.Properties.List[0].Value);
131131
}
@@ -154,7 +154,7 @@ public async Task TestAddNonExistingDocumentProperty()
154154
});
155155

156156
Assert.AreEqual((int)HttpStatusCode.OK, response.Code);
157-
Assert.AreEqual(52, response.Properties.List.Count);
157+
Assert.AreEqual(63, response.Properties.List.Count);
158158
Assert.IsNull(response.Properties.List.Where(p => p.Name == "new property").FirstOrDefault());
159159
}
160160
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
2+
// --------------------------------------------------------------------------------------------------------------------
3+
// <copyright company="Aspose" file="TestPrimaveraProperties.cs">
4+
// Copyright (c) 2022 Aspose.Tasks for Cloud
5+
// </copyright>
6+
// <summary>
7+
// Permission is hereby granted, free of charge, to any person obtaining a copy
8+
// of this software and associated documentation files (the "Software"), to deal
9+
// in the Software without restriction, including without limitation the rights
10+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
// copies of the Software, and to permit persons to whom the Software is
12+
// furnished to do so, subject to the following conditions:
13+
//
14+
// The above copyright notice and this permission notice shall be included in all
15+
// copies or substantial portions of the Software.
16+
//
17+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23+
// SOFTWARE.
24+
// </summary>
25+
// --------------------------------------------------------------------------------------------------------------------
26+
27+
using System;
28+
using System.Net;
29+
using Aspose.Tasks.Cloud.Sdk.Model;
30+
using Aspose.Tasks.Cloud.Sdk.Model.Requests;
31+
using Aspose.Tasks.Cloud.Sdk.Tests.Base;
32+
using NUnit.Framework;
33+
using Task = System.Threading.Tasks.Task;
34+
35+
namespace Aspose.Tasks.Cloud.Sdk.Tests.Tasks
36+
{
37+
[TestFixture]
38+
public class TestPrimaveraProperties : BaseTestContext
39+
{
40+
[Test]
41+
public async Task TestGetPrimaveraTaskProperties()
42+
{
43+
var remoteName = await UploadFileToStorageAsync("p6_multiproject.xml");
44+
45+
var response = await TasksApi.GetPrimaveraTaskPropertiesAsync(new GetPrimaveraTaskPropertiesRequest
46+
{
47+
Name = remoteName,
48+
Folder = this.DataFolder,
49+
TaskUid = 1
50+
});
51+
52+
Assert.AreEqual((int)HttpStatusCode.OK, response.Code);
53+
Assert.IsNotNull(response.PrimaveraProperties);
54+
55+
var entity = response.PrimaveraProperties;
56+
Assert.AreEqual(0, (int)entity.SequenceNumber);
57+
Assert.AreEqual("A1040", entity.ActivityId);
58+
Assert.AreEqual(new DateTime(2000, 10, 12, 8, 0, 0), entity.RemainingEarlyStart);
59+
Assert.AreEqual(new DateTime(2000, 10, 12, 17, 0, 0), entity.RemainingEarlyFinish);
60+
Assert.AreEqual(new DateTime(2000, 10, 12, 8, 0, 0), entity.RemainingLateStart);
61+
Assert.AreEqual(new DateTime(2000, 10, 12, 17, 0, 0), entity.RemainingLateFinish);
62+
Assert.AreEqual("Fixed Units", entity.RawDurationType);
63+
Assert.AreEqual("Task Dependent", entity.RawActivityType);
64+
Assert.AreEqual("Units", entity.RawCompletePercentType);
65+
Assert.AreEqual("Not Started", entity.RawStatus);
66+
}
67+
68+
}
69+
}

Aspose.Tasks.Cloud.Sdk/Api/TasksApi.cs

+56
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,62 @@ public TimephasedDataResponse GetAssignmentTimephasedData(GetAssignmentTimephase
638638
}
639639
}
640640

641+
/// <summary>
642+
/// Get primavera properties for a task with the specified Uid.
643+
/// </summary>
644+
/// <param name="request">Request. <see cref="GetPrimaveraTaskPropertiesRequest" /></param>
645+
/// <returns><see cref="PrimaveraTaskPropertiesResponse"/></returns>
646+
public PrimaveraTaskPropertiesResponse GetPrimaveraTaskProperties(GetPrimaveraTaskPropertiesRequest request)
647+
{
648+
// verify the required parameter 'name' is set
649+
if (request.Name == null)
650+
{
651+
throw new ApiException("Missing required parameter 'name' when calling GetPrimaveraTaskProperties",
652+
StatusCodes.ErrorInvalidInputData);
653+
}
654+
655+
// verify the required parameter 'taskUid' is set
656+
if (request.TaskUid == null)
657+
{
658+
throw new ApiException(
659+
"Missing required parameter 'taskUid' when calling GetPrimaveraTaskProperties",
660+
StatusCodes.ErrorInvalidInputData);
661+
}
662+
663+
// create path and map variables
664+
var resourcePath = UnescapePath(this.configuration.GetApiRootUrl() +
665+
"/tasks/{name}/tasks/{taskUid}/primaveraProperties");
666+
resourcePath = UrlHelper.AddPathParameter(resourcePath, "name", request.Name);
667+
resourcePath = UrlHelper.AddPathParameter(resourcePath, "taskUid", request.TaskUid);
668+
resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "folder", request.Folder);
669+
670+
try
671+
{
672+
var response = this.apiInvoker.InvokeApi(
673+
resourcePath,
674+
"GET",
675+
null,
676+
null,
677+
null);
678+
if (response != null)
679+
{
680+
return (PrimaveraTaskPropertiesResponse) SerializationHelper.Deserialize(response,
681+
typeof(PrimaveraTaskPropertiesResponse));
682+
}
683+
684+
return null;
685+
}
686+
catch (ApiException ex)
687+
{
688+
if (ex.HttpStatusCode == HttpStatusCode.NotFound)
689+
{
690+
return null;
691+
}
692+
693+
throw;
694+
}
695+
}
696+
641697
/// <summary>
642698
/// Get project&#39;s assignment items.
643699
/// </summary>

Aspose.Tasks.Cloud.Sdk/Api/TasksApiAsync.cs

+56
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,62 @@ public async Task<TimephasedDataResponse> GetAssignmentTimephasedDataAsync(GetAs
577577
}
578578
}
579579

580+
/// <summary>
581+
/// Get primavera properties for a task with the specified Uid.
582+
/// </summary>
583+
/// <param name="request">Request. <see cref="GetPrimaveraTaskPropertiesRequest" /></param>
584+
/// <returns><see cref="PrimaveraTaskPropertiesResponse"/></returns>
585+
public async Task<PrimaveraTaskPropertiesResponse> GetPrimaveraTaskPropertiesAsync(GetPrimaveraTaskPropertiesRequest request)
586+
{
587+
// verify the required parameter 'name' is set
588+
if (request.Name == null)
589+
{
590+
throw new ApiException("Missing required parameter 'name' when calling GetPrimaveraTaskProperties",
591+
StatusCodes.ErrorInvalidInputData);
592+
}
593+
594+
// verify the required parameter 'taskUid' is set
595+
if (request.TaskUid == null)
596+
{
597+
throw new ApiException(
598+
"Missing required parameter 'taskUid' when calling GetPrimaveraTaskProperties",
599+
StatusCodes.ErrorInvalidInputData);
600+
}
601+
602+
// create path and map variables
603+
var resourcePath = UnescapePath(this.configuration.GetApiRootUrl() +
604+
"/tasks/{name}/tasks/{taskUid}/primaveraProperties");
605+
resourcePath = UrlHelper.AddPathParameter(resourcePath, "name", request.Name);
606+
resourcePath = UrlHelper.AddPathParameter(resourcePath, "taskUid", request.TaskUid);
607+
resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "folder", request.Folder);
608+
609+
try
610+
{
611+
var response = await this.apiInvoker.InvokeApiAsync(
612+
resourcePath,
613+
"GET",
614+
null,
615+
null,
616+
null);
617+
if (response != null)
618+
{
619+
return (PrimaveraTaskPropertiesResponse)SerializationHelper.Deserialize(response,
620+
typeof(PrimaveraTaskPropertiesResponse));
621+
}
622+
623+
return null;
624+
}
625+
catch (ApiException ex)
626+
{
627+
if (ex.HttpStatusCode == HttpStatusCode.NotFound)
628+
{
629+
return null;
630+
}
631+
632+
throw;
633+
}
634+
}
635+
580636
/// <summary>
581637
/// Get project&#39;s assignment items.
582638
/// </summary>

Aspose.Tasks.Cloud.Sdk/Aspose.Tasks.Cloud.Sdk.csproj

+3
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,8 @@
160160
<Compile Include="Model\PageCountResponse.cs" />
161161
<Compile Include="Model\PageSize.cs" />
162162
<Compile Include="Model\PresentationFormat.cs" />
163+
<Compile Include="Model\PrimaveraTaskProperties.cs" />
164+
<Compile Include="Model\PrimaveraTaskPropertiesResponse.cs" />
163165
<Compile Include="Model\ProbabilityDistributionType.cs" />
164166
<Compile Include="Model\ProjectDatabaseType.cs" />
165167
<Compile Include="Model\ProjectFileFormat.cs" />
@@ -204,6 +206,7 @@
204206
<Compile Include="Model\Requests\GetOutlineCodeByIndexRequest.cs" />
205207
<Compile Include="Model\Requests\GetOutlineCodesRequest.cs" />
206208
<Compile Include="Model\Requests\GetPageCountRequest.cs" />
209+
<Compile Include="Model\Requests\GetPrimaveraTaskPropertiesRequest.cs" />
207210
<Compile Include="Model\Requests\GetProjectIdsRequest.cs" />
208211
<Compile Include="Model\Requests\GetProjectListRequest.cs" />
209212
<Compile Include="Model\Requests\GetReportPdfRequest.cs" />

Aspose.Tasks.Cloud.Sdk/Aspose.Tasks.Cloud.Sdk.nuspec

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<package >
33
<metadata>
44
<id>Aspose.Tasks-Cloud</id>
5-
<version>22.7</version>
5+
<version>22.12</version>
66
<title>Aspose.Tasks Cloud SDK for .NET</title>
77
<summary>Aspose.Tasks Cloud SDK allows developer to manipulate or convert Microsoft Project documents hosted on a cloud platform from .NET applications</summary>
88
<authors>Aspose</authors>
@@ -14,9 +14,9 @@
1414
<description>New generation of Aspose Cloud SDK that allows to manipulate or convert Microsoft Project documents hosted on a cloud platform from .NET applications. It allows you to work with all aspects of a Project document including conversion. The API offers a wide range of Microsoft Project export options. The Aspose.Tasks Cloud API allows developers to convert Project documents to various formats including XML, HTML, BMP, PNG, PDF, and XSLX.
1515
</description>
1616
<releaseNotes>
17-
The complete list of changes can be found at https://docs.aspose.cloud/tasks/aspose-tasks-cloud-22-7-release-notes/
17+
The complete list of changes can be found at https://docs.aspose.cloud/tasks/aspose-tasks-cloud-22-12-release-notes/
1818
</releaseNotes>
19-
<copyright>Aspose 2002-2021. All Rights Reserved.</copyright>
19+
<copyright>Aspose 2002-2022. All Rights Reserved.</copyright>
2020
<tags>MPP Primavera Microsoft Project Server Online P6XML PrimaveraXML XER MPX</tags>
2121
<dependencies>
2222
<dependency id="Newtonsoft.Json" version="13.0.1" />
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
using System;
2+
3+
namespace Aspose.Tasks.Cloud.Sdk.Model
4+
{
5+
/// <summary>
6+
/// Represents Primavera-specific properties for a task read from Primavera format (XER of P6XML).
7+
/// </summary>
8+
public class PrimaveraTaskProperties
9+
{
10+
/// <summary>
11+
/// The sequence number of the WBS item (summary tasks). It is used to sort summary tasks in Primavera.
12+
/// </summary>
13+
/// <remarks>
14+
/// Applicable to WBS items (summary tasks).
15+
/// </remarks>
16+
public int SequenceNumber { get; set; }
17+
18+
/// <summary>
19+
/// Activity id field - a task's unique identifier used by Primavera.
20+
/// </summary>
21+
/// <remarks>
22+
/// Applicable only to activities (non-summary tasks).
23+
/// </remarks>
24+
public string ActivityId { get; set; }
25+
26+
/// <summary>
27+
/// Remaining early finish date - the date when the remaining work for the activity is scheduled to be finished.
28+
/// </summary>
29+
public DateTime RemainingEarlyFinish { get; set; }
30+
31+
/// <summary>
32+
/// Remaining early start date - the date when the remaining work for the activity is scheduled to begin.
33+
/// </summary>
34+
public DateTime RemainingEarlyStart { get; set; }
35+
36+
/// <summary>
37+
/// Remaining late start date.
38+
/// </summary>
39+
public DateTime RemainingLateStart { get; set; }
40+
41+
/// <summary>
42+
/// Remaining late finish date.
43+
/// </summary>
44+
public DateTime RemainingLateFinish { get; set; }
45+
46+
/// <summary>
47+
/// Raw text representation (as in source file) of 'Duration Type' field of the activity.
48+
/// </summary>
49+
/// <remarks>
50+
/// Applicable only to activities (non-summary tasks).
51+
/// </remarks>
52+
public string RawDurationType { get; set; }
53+
54+
/// <summary>
55+
/// Raw text representation (as in source file) of 'Activity Type' field of the activity.
56+
/// </summary>
57+
/// <remarks>
58+
/// Applicable only to activities (non-summary tasks).
59+
/// </remarks>
60+
public string RawActivityType { get; set; }
61+
62+
/// <summary>
63+
/// Raw text representation (as in source file) of '% Complete Type' field of the activity.
64+
/// </summary>
65+
/// <remarks>
66+
/// Applicable only to activities (non-summary tasks).
67+
/// </remarks>
68+
public string RawCompletePercentType { get; set; }
69+
70+
/// <summary>
71+
/// Raw text representation (as in source file) of 'Status' field of the activity.
72+
/// </summary>
73+
/// <remarks>
74+
/// Applicable only to activities (non-summary tasks).
75+
/// </remarks>
76+
public string RawStatus { get; set; }
77+
}
78+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
namespace Aspose.Tasks.Cloud.Sdk.Model
2+
{
3+
/// <summary>
4+
/// PrimaveraProperties response.
5+
/// </summary>
6+
public class PrimaveraTaskPropertiesResponse : AsposeResponse
7+
{
8+
/// <summary>
9+
/// PrimaveraTaskProperties DTO
10+
/// </summary>
11+
public PrimaveraTaskProperties PrimaveraProperties { get; set; }
12+
}
13+
}

0 commit comments

Comments
 (0)