Skip to content

Commit 232e8ee

Browse files
[Update] PIM classes according to Version 1.0 Beta 3 - (Release 2025-02)
1 parent 0cf5d03 commit 232e8ee

18 files changed

+246
-48
lines changed

SySML2.NET.REST.Tests/RestClientTestFixture.cs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -83,27 +83,27 @@ public async Task Verify_that_RestClient_can_query_projects_branches_tags_commit
8383
Assert.That(branch.OwningProject, Is.EqualTo(project.Id));
8484
}
8585

86-
var commits = await this.restClient.RequestCommits(project.Id, null, null, this.cancellationTokenSource.Token);
87-
88-
foreach (var commit in commits)
89-
{
90-
Assert.That(commit.OwningProject, Is.EqualTo(project.Id));
91-
92-
var elements = await this.restClient.RequestElements(project.Id, commit.Id, null, null, this.cancellationTokenSource.Token);
93-
94-
foreach (var element in elements)
95-
{
96-
Assert.That(element.Id, Is.Not.Null.Or.Empty);
97-
}
98-
}
99-
10086
var tags = await this.restClient.RequestTags(project.Id, null, null, this.cancellationTokenSource.Token);
10187

10288
foreach (var tag in tags)
10389
{
10490
Assert.That(tag.Name, Is.Not.Null.Or.Empty);
10591
Assert.That(tag.OwningProject, Is.EqualTo(project.Id));
10692
}
93+
94+
var commits = await this.restClient.RequestCommits(project.Id, null, null, this.cancellationTokenSource.Token);
95+
96+
foreach (var commit in commits)
97+
{
98+
Assert.That(commit.OwningProject, Is.EqualTo(project.Id));
99+
100+
// var elements = await this.restClient.RequestElements(project.Id, commit.Id, null, null, this.cancellationTokenSource.Token);
101+
102+
//foreach (var element in elements)
103+
//{
104+
// Assert.That(element.Id, Is.Not.Null.Or.Empty);
105+
//}
106+
}
107107
}
108108
}
109109
}

SysML2.NET/PIM/ChangeType.cs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// -------------------------------------------------------------------------------------------------
2+
// <copyright file="ChangeType.cs" company="Starion Group S.A.">
3+
//
4+
// Copyright 2022-2025 Starion Group S.A.
5+
//
6+
// Licensed under the Apache License, Version 2.0 (the "License");
7+
// you may not use this file except in compliance with the License.
8+
// You may obtain a copy of the License at
9+
//
10+
// http://www.apache.org/licenses/LICENSE-2.0
11+
//
12+
// Unless required by applicable law or agreed to in writing, software
13+
// distributed under the License is distributed on an "AS IS" BASIS,
14+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
// See the License for the specific language governing permissions and
16+
// limitations under the License.
17+
//
18+
// </copyright>
19+
// ------------------------------------------------------------------------------------------------
20+
21+
namespace SysML2.NET.PIM
22+
{
23+
public enum ChangeType
24+
{
25+
CREATED,
26+
27+
DELETED,
28+
29+
UPDATED,
30+
}
31+
}

SysML2.NET/PIM/DTO/CommitReference.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,18 @@ public abstract class CommitReference : Record
3535
public DateTime Created { get; set; }
3636

3737
/// <summary>
38-
/// Gets or sets the name of the <see cref="CommitReference"/>
38+
/// Gets or sets the timestamp at which the <see cref="CommitReference"/> was deleted
3939
/// </summary>
40-
public string Name { get; set; }
40+
public DateTime Deleted { get; set; }
4141

4242
/// <summary>
4343
/// Gets or sets the Project that owns the given <see cref="CommitReference"/>
4444
/// </summary>
4545
public Guid OwningProject { get; set; }
46+
47+
/// <summary>
48+
/// Gets or sets the name of the <see cref="CommitReference"/>
49+
/// </summary>
50+
public new string Name { get; set; }
4651
}
4752
}

SysML2.NET/PIM/DTO/CompositeConstraint.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public class CompositeConstraint : Constraint
3434
/// <remarks>
3535
/// There must be at least 2
3636
/// </remarks>
37-
public List<Constraint> Constraint { get; set; }
37+
public List<Constraint> Constraint { get; set; } = [];
3838

3939
/// <summary>
4040
/// Gets or sets the logical operator for composing the <see cref="Constraint"/>s
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// -------------------------------------------------------------------------------------------------
2+
// <copyright file="DataDifference.cs" company="Starion Group S.A.">
3+
//
4+
// Copyright 2022-2025 Starion Group S.A.
5+
//
6+
// Licensed under the Apache License, Version 2.0 (the "License");
7+
// you may not use this file except in compliance with the License.
8+
// You may obtain a copy of the License at
9+
//
10+
// http://www.apache.org/licenses/LICENSE-2.0
11+
//
12+
// Unless required by applicable law or agreed to in writing, software
13+
// distributed under the License is distributed on an "AS IS" BASIS,
14+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
// See the License for the specific language governing permissions and
16+
// limitations under the License.
17+
//
18+
// </copyright>
19+
// ------------------------------------------------------------------------------------------------
20+
21+
namespace SysML2.NET.PIM.DTO
22+
{
23+
using System;
24+
25+
public class DataDifference
26+
{
27+
public Guid? BaseData { get; set; }
28+
29+
public Guid? CompareData { get; set; }
30+
}
31+
}

SysML2.NET/PIM/DTO/MergeResult.cs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// -------------------------------------------------------------------------------------------------
2+
// <copyright file="MergeResult.cs" company="Starion Group S.A.">
3+
//
4+
// Copyright 2022-2025 Starion Group S.A.
5+
//
6+
// Licensed under the Apache License, Version 2.0 (the "License");
7+
// you may not use this file except in compliance with the License.
8+
// You may obtain a copy of the License at
9+
//
10+
// http://www.apache.org/licenses/LICENSE-2.0
11+
//
12+
// Unless required by applicable law or agreed to in writing, software
13+
// distributed under the License is distributed on an "AS IS" BASIS,
14+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
// See the License for the specific language governing permissions and
16+
// limitations under the License.
17+
//
18+
// </copyright>
19+
// ------------------------------------------------------------------------------------------------
20+
21+
namespace SysML2.NET.PIM.DTO
22+
{
23+
using System;
24+
using System.Collections.Generic;
25+
26+
public class MergeResult
27+
{
28+
public List<Guid> Conflict { get; set; } = [];
29+
30+
public Guid MergeCommit { get; set; }
31+
}
32+
}

SysML2.NET/PIM/DTO/PrimitiveConstraint.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
namespace SysML2.NET.PIM.DTO
2222
{
23-
using System;
2423
using System.Collections.Generic;
2524

2625
/// <summary>
@@ -35,14 +34,14 @@ public class PrimitiveConstraint
3534
public string Property { get; set; }
3635

3736
/// <summary>
38-
/// Gets or sets the mathematical operatores
37+
/// Gets or sets the mathematical operators
3938
/// </summary>
4039
public Operator Operator { get; set; }
4140

4241
/// <summary>
4342
/// Gets or sets list of primitive objects, such as String, Boolean, Integer, Double, and UUID
4443
/// </summary>
45-
public List<string> Value { get; set;} = new List<string>();
44+
public List<string> Value { get; set;} = [];
4645

4746
/// <summary>
4847
/// Gets or sets a value indicating a logical NOT operator is applied to the <see cref="PrimitiveConstraint"/>

SysML2.NET/PIM/DTO/Project.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ namespace SysML2.NET.PIM.DTO
3131
/// </summary>
3232
public class Project : Record
3333
{
34+
public List<Guid> Commits { get; set; } = new List<Guid>();
35+
3436
/// <summary>
3537
/// Gets or sets the <see cref="DateTime"/> when the project was created
3638
/// </summary>
@@ -45,5 +47,7 @@ public class Project : Record
4547
/// Gets or sets the default <see cref="Branch"/> in the <see cref="Project"/> which is a subset of <see cref="Branch"/>
4648
/// </summary>
4749
public Guid DefaultBranch { get; set; }
50+
51+
public List<Guid> Queries { get; set; } = [];
4852
}
4953
}

SysML2.NET/PIM/DTO/Query.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,26 @@ namespace SysML2.NET.PIM.DTO
3131
public class Query : Record
3232
{
3333
/// <summary>
34-
/// Gets or sets the unique identifier of the owning <see cref="Project"/>
34+
/// Gets or sets the name of the Query
3535
/// </summary>
36-
public Guid OwningProject { get; set; }
36+
public new string Name { get; set; }
3737

3838
/// <summary>
3939
/// list of properties of Element or its subtypes that will be included for each Element object in the
4040
/// query response. Element is the root-metaclass in KerML. If no properties are specified, then all the
4141
/// properties will be included for each Element in the query response
4242
/// </summary>
43-
public List<string> Select { get; set; }
43+
public List<string> Select { get; set; } = [];
4444

4545
/// <summary>
4646
/// represents the conditions that Elements in the query response must satisfy
4747
/// </summary>
4848
public Constraint Where { get; set; }
49+
50+
/// <summary>
51+
/// list of Data objects that define the scope context for query execution. The default scope of a
52+
/// Query is the owning Project
53+
/// </summary>
54+
public List<Guid> Scope { get; set; } = [];
4955
}
5056
}

SysML2.NET/PIM/Direction.cs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// -------------------------------------------------------------------------------------------------
2+
// <copyright file="Direction.cs" company="Starion Group S.A.">
3+
//
4+
// Copyright 2022-2025 Starion Group S.A.
5+
//
6+
// Licensed under the Apache License, Version 2.0 (the "License");
7+
// you may not use this file except in compliance with the License.
8+
// You may obtain a copy of the License at
9+
//
10+
// http://www.apache.org/licenses/LICENSE-2.0
11+
//
12+
// Unless required by applicable law or agreed to in writing, software
13+
// distributed under the License is distributed on an "AS IS" BASIS,
14+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
// See the License for the specific language governing permissions and
16+
// limitations under the License.
17+
//
18+
// </copyright>
19+
// ------------------------------------------------------------------------------------------------
20+
21+
namespace SysML2.NET.PIM
22+
{
23+
public enum Direction
24+
{
25+
both,
26+
27+
@in,
28+
29+
@out
30+
}
31+
}

0 commit comments

Comments
 (0)