Skip to content

Commit b06a73d

Browse files
committed
feat: support more FOSSology properties
1 parent 8f71853 commit b06a73d

File tree

5 files changed

+86
-6
lines changed

5 files changed

+86
-6
lines changed

ChangeLog.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# ChangeLog - FOSSology.REST.dotnet
22

3+
## 1.5.0 (2025-08-07)
4+
5+
* Support of more scan/decider options:
6+
* `ConcludeLicenseType`
7+
* `CopyrightDeactivation`
8+
* `CopyrightClutterRemoval`
9+
* `Patent`
10+
* `Heritage`
11+
* `Compatibility`
12+
* More Upload properties
13+
* `AssigneeDate`
14+
* `ClosingDate`
15+
316
## 1.4.1 (2024-10-19)
417

518
* Dependency updates, especially RestSharp 108.0.3 to 112.1.0 to fix a security vulnerability.

Fossology.Rest.Dotnet.Model/Analysis.cs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ---------------------------------------------------------------------------
22
// <copyright file="Analysis.cs" company="Tethys">
3-
// Copyright (C) 2020-2022 T. Graf
3+
// Copyright (C) 2020-2025 T. Graf
44
// </copyright>
55
//
66
// Licensed under the MIT License.
@@ -80,5 +80,23 @@ public class Analysis
8080
/// </summary>
8181
[JsonProperty("reso")]
8282
public bool Reso { get; set; }
83+
84+
/// <summary>
85+
/// Gets or sets a value indicating whether to use the patent analysis.
86+
/// </summary>
87+
[JsonProperty("patent")]
88+
public bool Patent { get; set; }
89+
90+
/// <summary>
91+
/// Gets or sets a value indicating whether to use the Software Heritage analysis.
92+
/// </summary>
93+
[JsonProperty("heritage")]
94+
public bool Heritage { get; set; }
95+
96+
/// <summary>
97+
/// Gets or sets a value indicating whether to use the compatibility analysis.
98+
/// </summary>
99+
[JsonProperty("compatibility")]
100+
public bool Compatibility { get; set; }
83101
} // Analysis
84102
}

Fossology.Rest.Dotnet.Model/DeciderInfo.cs

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ---------------------------------------------------------------------------
22
// <copyright file="DeciderInfo.cs" company="Tethys">
3-
// Copyright (C) 2019-2020 T. Graf
3+
// Copyright (C) 2019-2025 T. Graf
44
// </copyright>
55
//
66
// Licensed under the MIT License.
@@ -44,5 +44,25 @@ public class DeciderInfo
4444
/// </summary>
4545
[JsonProperty("ojo_decider")]
4646
public bool OjoDecider { get; set; }
47+
48+
/// <summary>
49+
/// Gets or sets the type of the auto conclude license.
50+
/// Auto conclude license if they are of provided type. Omit the field or keep as
51+
/// empty string to not use this option.
52+
/// </summary>
53+
[JsonProperty("conclude_license_type")]
54+
public string ConcludeLicenseType { get; set; }
55+
56+
/// <summary>
57+
/// Gets or sets a value indicating whether to do copyright deactivation.
58+
/// </summary>
59+
[JsonProperty("copyright_deactivation")]
60+
public bool CopyrightDeactivation { get; set; }
61+
62+
/// <summary>
63+
/// Gets or sets a value indicating whether to use copyright clutter removal.
64+
/// </summary>
65+
[JsonProperty("copyright_clutter_removal")]
66+
public bool CopyrightClutterRemoval { get; set; }
4767
} // DeciderInfo
4868
}

Fossology.Rest.Dotnet.Model/Upload.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ---------------------------------------------------------------------------
22
// <copyright file="Upload.cs" company="Tethys">
3-
// Copyright (C) 2019-2022 T. Graf
3+
// Copyright (C) 2019-2025 T. Graf
44
// </copyright>
55
//
66
// Licensed under the MIT License.
@@ -76,6 +76,18 @@ public class Upload
7676
[JsonProperty("assignee", DefaultValueHandling = DefaultValueHandling.Ignore)]
7777
public string Assignee { get; set; }
7878

79+
/// <summary>
80+
/// Gets or sets the date, when a user was assigned to the upload.
81+
/// </summary>
82+
[JsonProperty("assigneeDate", DefaultValueHandling = DefaultValueHandling.Ignore)]
83+
public string AssigneeDate { get; set; }
84+
85+
/// <summary>
86+
/// Gets or sets the date, when the upload was closed or rejected.
87+
/// </summary>
88+
[JsonProperty("closingDate", DefaultValueHandling = DefaultValueHandling.Ignore)]
89+
public string ClosingDate { get; set; }
90+
7991
/// <summary>
8092
/// Gets or sets the hash of the file.
8193
/// </summary>

Fossology.Rest.Dotnet.Test/FossologyClientTest.cs

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ---------------------------------------------------------------------------
22
// <copyright file="FossologyClientTest.cs" company="Tethys">
3-
// Copyright (C) 2019-2023 T. Graf
3+
// Copyright (C) 2019-2025 T. Graf
44
// </copyright>
55
//
66
// Licensed under the MIT License.
@@ -45,7 +45,7 @@ public class FossologyClientTest
4545
/// <summary>
4646
/// The access token.
4747
/// </summary>
48-
private const string Token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3Mjk2NDE1OTksIm5iZiI6MTcyOTI5NjAwMCwianRpIjoiTWk0eiIsInNjb3BlIjoid3JpdGUifQ.XDoC_pByw2RaxJFO_F-PM7zrJlCIyu1G3UyD3_7QeQ4";
48+
private const string Token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3NTQ4NzAzOTksIm5iZiI6MTc1NDUyNDgwMCwianRpIjoiTWk0eiIsInNjb3BlIjoid3JpdGUifQ.HlCrnsrdD8fzjpzcoD5I6ozZRtb5obgja5vIf-pI0gk";
4949

5050
/// <summary>
5151
/// The filename of a test package.
@@ -576,6 +576,8 @@ public void TestTriggerJob()
576576
job.Decider.BulkReused = true;
577577
job.Decider.NewScanner = true;
578578
job.Decider.OjoDecider = true;
579+
job.Decider.CopyrightDeactivation = true;
580+
job.Decider.CopyrightClutterRemoval = true;
579581
job.Reuse.ReuseUploadId = 0;
580582
job.Reuse.ReuseGroup = 0;
581583
job.Reuse.ReuseMain = true;
@@ -723,7 +725,7 @@ public void TestDownloadReport()
723725
var reportId = TriggerReportGeneration(uploadId);
724726

725727
// ugly but required: wait some time until report is available
726-
Thread.Sleep(3000);
728+
Thread.Sleep(5000);
727729

728730
var client = new FossologyClient(LocalUrl, Token);
729731
client.DownloadReport(reportId, ReportName);
@@ -1188,6 +1190,21 @@ public void TestDeleteUserSuccess()
11881190
Assert.AreEqual(202, result.Code);
11891191
}
11901192
#endif
1193+
1194+
/// <summary>
1195+
/// Unit test.
1196+
/// </summary>
1197+
[TestMethod]
1198+
public void TestGetScanCodeResults()
1199+
{
1200+
const int UploadId = 8;
1201+
1202+
var client = new FossologyClient(LocalUrl, Token);
1203+
var itemId = client.GetTopItem(UploadId);
1204+
1205+
var result = client.GetUploadScanCodeCopyrights(UploadId, itemId, "active", 100, 1);
1206+
Assert.IsNotNull(result);
1207+
}
11911208
#endregion TESTS THAT REQUIRE MANUAL PREPARATION
11921209

11931210
//// ---------------------------------------------------------------------

0 commit comments

Comments
 (0)