Skip to content

Commit

Permalink
[TASKSCLOUD-682] - Deployed new 22.12 version.
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanAndreychikov committed Dec 14, 2022
1 parent d1bb3fe commit 3073885
Show file tree
Hide file tree
Showing 12 changed files with 323 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
<Compile Include="Reports\TestReport.cs" />
<Compile Include="Resources\TestResources.cs" />
<Compile Include="TaskLinks\TaskLinksTests.cs" />
<Compile Include="Tasks\TestPrimaveraProperties.cs" />
<Compile Include="Tasks\TestRecurringInfo.cs" />
<Compile Include="Tasks\TestTasksExtendedAttributes.cs" />
<Compile Include="Tasks\TestTasks.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public async Task TestGetDocumentProperties()
});

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

Assert.AreEqual((int)HttpStatusCode.OK, response.Code);
Assert.AreEqual(52, response.Properties.List.Count);
Assert.AreEqual(63, response.Properties.List.Count);
Assert.AreEqual("Title", response.Properties.List[0].Name);
Assert.AreEqual("New title value", response.Properties.List[0].Value);
}
Expand Down Expand Up @@ -125,7 +125,7 @@ public async Task TestEditDocumentPropertyViaPost()
});

Assert.AreEqual((int)HttpStatusCode.OK, response.Code);
Assert.AreEqual(52, response.Properties.List.Count);
Assert.AreEqual(63, response.Properties.List.Count);
Assert.AreEqual("Title", response.Properties.List[0].Name);
Assert.AreEqual("New title value", response.Properties.List[0].Value);
}
Expand Down Expand Up @@ -154,7 +154,7 @@ public async Task TestAddNonExistingDocumentProperty()
});

Assert.AreEqual((int)HttpStatusCode.OK, response.Code);
Assert.AreEqual(52, response.Properties.List.Count);
Assert.AreEqual(63, response.Properties.List.Count);
Assert.IsNull(response.Properties.List.Where(p => p.Name == "new property").FirstOrDefault());
}
}
Expand Down
69 changes: 69 additions & 0 deletions Aspose.Tasks.Cloud.Sdk.Tests/Tasks/TestPrimaveraProperties.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@

// --------------------------------------------------------------------------------------------------------------------
// <copyright company="Aspose" file="TestPrimaveraProperties.cs">
// Copyright (c) 2022 Aspose.Tasks for Cloud
// </copyright>
// <summary>
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

using System;
using System.Net;
using Aspose.Tasks.Cloud.Sdk.Model;
using Aspose.Tasks.Cloud.Sdk.Model.Requests;
using Aspose.Tasks.Cloud.Sdk.Tests.Base;
using NUnit.Framework;
using Task = System.Threading.Tasks.Task;

namespace Aspose.Tasks.Cloud.Sdk.Tests.Tasks
{
[TestFixture]
public class TestPrimaveraProperties : BaseTestContext
{
[Test]
public async Task TestGetPrimaveraTaskProperties()
{
var remoteName = await UploadFileToStorageAsync("p6_multiproject.xml");

var response = await TasksApi.GetPrimaveraTaskPropertiesAsync(new GetPrimaveraTaskPropertiesRequest
{
Name = remoteName,
Folder = this.DataFolder,
TaskUid = 1
});

Assert.AreEqual((int)HttpStatusCode.OK, response.Code);
Assert.IsNotNull(response.PrimaveraProperties);

var entity = response.PrimaveraProperties;
Assert.AreEqual(0, (int)entity.SequenceNumber);
Assert.AreEqual("A1040", entity.ActivityId);
Assert.AreEqual(new DateTime(2000, 10, 12, 8, 0, 0), entity.RemainingEarlyStart);
Assert.AreEqual(new DateTime(2000, 10, 12, 17, 0, 0), entity.RemainingEarlyFinish);
Assert.AreEqual(new DateTime(2000, 10, 12, 8, 0, 0), entity.RemainingLateStart);
Assert.AreEqual(new DateTime(2000, 10, 12, 17, 0, 0), entity.RemainingLateFinish);
Assert.AreEqual("Fixed Units", entity.RawDurationType);
Assert.AreEqual("Task Dependent", entity.RawActivityType);
Assert.AreEqual("Units", entity.RawCompletePercentType);
Assert.AreEqual("Not Started", entity.RawStatus);
}

}
}
56 changes: 56 additions & 0 deletions Aspose.Tasks.Cloud.Sdk/Api/TasksApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,62 @@ public TimephasedDataResponse GetAssignmentTimephasedData(GetAssignmentTimephase
}
}

/// <summary>
/// Get primavera properties for a task with the specified Uid.
/// </summary>
/// <param name="request">Request. <see cref="GetPrimaveraTaskPropertiesRequest" /></param>
/// <returns><see cref="PrimaveraTaskPropertiesResponse"/></returns>
public PrimaveraTaskPropertiesResponse GetPrimaveraTaskProperties(GetPrimaveraTaskPropertiesRequest request)
{
// verify the required parameter 'name' is set
if (request.Name == null)
{
throw new ApiException("Missing required parameter 'name' when calling GetPrimaveraTaskProperties",
StatusCodes.ErrorInvalidInputData);
}

// verify the required parameter 'taskUid' is set
if (request.TaskUid == null)
{
throw new ApiException(
"Missing required parameter 'taskUid' when calling GetPrimaveraTaskProperties",
StatusCodes.ErrorInvalidInputData);
}

// create path and map variables
var resourcePath = UnescapePath(this.configuration.GetApiRootUrl() +
"/tasks/{name}/tasks/{taskUid}/primaveraProperties");
resourcePath = UrlHelper.AddPathParameter(resourcePath, "name", request.Name);
resourcePath = UrlHelper.AddPathParameter(resourcePath, "taskUid", request.TaskUid);
resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "folder", request.Folder);

try
{
var response = this.apiInvoker.InvokeApi(
resourcePath,
"GET",
null,
null,
null);
if (response != null)
{
return (PrimaveraTaskPropertiesResponse) SerializationHelper.Deserialize(response,
typeof(PrimaveraTaskPropertiesResponse));
}

return null;
}
catch (ApiException ex)
{
if (ex.HttpStatusCode == HttpStatusCode.NotFound)
{
return null;
}

throw;
}
}

/// <summary>
/// Get project&#39;s assignment items.
/// </summary>
Expand Down
56 changes: 56 additions & 0 deletions Aspose.Tasks.Cloud.Sdk/Api/TasksApiAsync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,62 @@ public async Task<TimephasedDataResponse> GetAssignmentTimephasedDataAsync(GetAs
}
}

/// <summary>
/// Get primavera properties for a task with the specified Uid.
/// </summary>
/// <param name="request">Request. <see cref="GetPrimaveraTaskPropertiesRequest" /></param>
/// <returns><see cref="PrimaveraTaskPropertiesResponse"/></returns>
public async Task<PrimaveraTaskPropertiesResponse> GetPrimaveraTaskPropertiesAsync(GetPrimaveraTaskPropertiesRequest request)
{
// verify the required parameter 'name' is set
if (request.Name == null)
{
throw new ApiException("Missing required parameter 'name' when calling GetPrimaveraTaskProperties",
StatusCodes.ErrorInvalidInputData);
}

// verify the required parameter 'taskUid' is set
if (request.TaskUid == null)
{
throw new ApiException(
"Missing required parameter 'taskUid' when calling GetPrimaveraTaskProperties",
StatusCodes.ErrorInvalidInputData);
}

// create path and map variables
var resourcePath = UnescapePath(this.configuration.GetApiRootUrl() +
"/tasks/{name}/tasks/{taskUid}/primaveraProperties");
resourcePath = UrlHelper.AddPathParameter(resourcePath, "name", request.Name);
resourcePath = UrlHelper.AddPathParameter(resourcePath, "taskUid", request.TaskUid);
resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "folder", request.Folder);

try
{
var response = await this.apiInvoker.InvokeApiAsync(
resourcePath,
"GET",
null,
null,
null);
if (response != null)
{
return (PrimaveraTaskPropertiesResponse)SerializationHelper.Deserialize(response,
typeof(PrimaveraTaskPropertiesResponse));
}

return null;
}
catch (ApiException ex)
{
if (ex.HttpStatusCode == HttpStatusCode.NotFound)
{
return null;
}

throw;
}
}

/// <summary>
/// Get project&#39;s assignment items.
/// </summary>
Expand Down
3 changes: 3 additions & 0 deletions Aspose.Tasks.Cloud.Sdk/Aspose.Tasks.Cloud.Sdk.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@
<Compile Include="Model\PageCountResponse.cs" />
<Compile Include="Model\PageSize.cs" />
<Compile Include="Model\PresentationFormat.cs" />
<Compile Include="Model\PrimaveraTaskProperties.cs" />
<Compile Include="Model\PrimaveraTaskPropertiesResponse.cs" />
<Compile Include="Model\ProbabilityDistributionType.cs" />
<Compile Include="Model\ProjectDatabaseType.cs" />
<Compile Include="Model\ProjectFileFormat.cs" />
Expand Down Expand Up @@ -204,6 +206,7 @@
<Compile Include="Model\Requests\GetOutlineCodeByIndexRequest.cs" />
<Compile Include="Model\Requests\GetOutlineCodesRequest.cs" />
<Compile Include="Model\Requests\GetPageCountRequest.cs" />
<Compile Include="Model\Requests\GetPrimaveraTaskPropertiesRequest.cs" />
<Compile Include="Model\Requests\GetProjectIdsRequest.cs" />
<Compile Include="Model\Requests\GetProjectListRequest.cs" />
<Compile Include="Model\Requests\GetReportPdfRequest.cs" />
Expand Down
6 changes: 3 additions & 3 deletions Aspose.Tasks.Cloud.Sdk/Aspose.Tasks.Cloud.Sdk.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package >
<metadata>
<id>Aspose.Tasks-Cloud</id>
<version>22.7</version>
<version>22.12</version>
<title>Aspose.Tasks Cloud SDK for .NET</title>
<summary>Aspose.Tasks Cloud SDK allows developer to manipulate or convert Microsoft Project documents hosted on a cloud platform from .NET applications</summary>
<authors>Aspose</authors>
Expand All @@ -14,9 +14,9 @@
<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.
</description>
<releaseNotes>
The complete list of changes can be found at https://docs.aspose.cloud/tasks/aspose-tasks-cloud-22-7-release-notes/
The complete list of changes can be found at https://docs.aspose.cloud/tasks/aspose-tasks-cloud-22-12-release-notes/
</releaseNotes>
<copyright>Aspose 2002-2021. All Rights Reserved.</copyright>
<copyright>Aspose 2002-2022. All Rights Reserved.</copyright>
<tags>MPP Primavera Microsoft Project Server Online P6XML PrimaveraXML XER MPX</tags>
<dependencies>
<dependency id="Newtonsoft.Json" version="13.0.1" />
Expand Down
78 changes: 78 additions & 0 deletions Aspose.Tasks.Cloud.Sdk/Model/PrimaveraTaskProperties.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
using System;

namespace Aspose.Tasks.Cloud.Sdk.Model
{
/// <summary>
/// Represents Primavera-specific properties for a task read from Primavera format (XER of P6XML).
/// </summary>
public class PrimaveraTaskProperties
{
/// <summary>
/// The sequence number of the WBS item (summary tasks). It is used to sort summary tasks in Primavera.
/// </summary>
/// <remarks>
/// Applicable to WBS items (summary tasks).
/// </remarks>
public int SequenceNumber { get; set; }

/// <summary>
/// Activity id field - a task's unique identifier used by Primavera.
/// </summary>
/// <remarks>
/// Applicable only to activities (non-summary tasks).
/// </remarks>
public string ActivityId { get; set; }

/// <summary>
/// Remaining early finish date - the date when the remaining work for the activity is scheduled to be finished.
/// </summary>
public DateTime RemainingEarlyFinish { get; set; }

/// <summary>
/// Remaining early start date - the date when the remaining work for the activity is scheduled to begin.
/// </summary>
public DateTime RemainingEarlyStart { get; set; }

/// <summary>
/// Remaining late start date.
/// </summary>
public DateTime RemainingLateStart { get; set; }

/// <summary>
/// Remaining late finish date.
/// </summary>
public DateTime RemainingLateFinish { get; set; }

/// <summary>
/// Raw text representation (as in source file) of 'Duration Type' field of the activity.
/// </summary>
/// <remarks>
/// Applicable only to activities (non-summary tasks).
/// </remarks>
public string RawDurationType { get; set; }

/// <summary>
/// Raw text representation (as in source file) of 'Activity Type' field of the activity.
/// </summary>
/// <remarks>
/// Applicable only to activities (non-summary tasks).
/// </remarks>
public string RawActivityType { get; set; }

/// <summary>
/// Raw text representation (as in source file) of '% Complete Type' field of the activity.
/// </summary>
/// <remarks>
/// Applicable only to activities (non-summary tasks).
/// </remarks>
public string RawCompletePercentType { get; set; }

/// <summary>
/// Raw text representation (as in source file) of 'Status' field of the activity.
/// </summary>
/// <remarks>
/// Applicable only to activities (non-summary tasks).
/// </remarks>
public string RawStatus { get; set; }
}
}
13 changes: 13 additions & 0 deletions Aspose.Tasks.Cloud.Sdk/Model/PrimaveraTaskPropertiesResponse.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace Aspose.Tasks.Cloud.Sdk.Model
{
/// <summary>
/// PrimaveraProperties response.
/// </summary>
public class PrimaveraTaskPropertiesResponse : AsposeResponse
{
/// <summary>
/// PrimaveraTaskProperties DTO
/// </summary>
public PrimaveraTaskProperties PrimaveraProperties { get; set; }
}
}
Loading

0 comments on commit 3073885

Please sign in to comment.