27
27
from packageurl import PackageURL # type: ignore
28
28
from sortedcontainers import SortedSet
29
29
30
- from cyclonedx .serialization import BomRefHelper
31
-
32
30
from ..exception .model import NoPropertiesProvidedException
33
- from ..serialization import PackageUrl
31
+ from ..serialization import BomRefHelper , PackageUrl
34
32
from . import (
35
33
AttachedText ,
36
34
ComparableTuple ,
@@ -74,7 +72,8 @@ def __init__(self, *, uid: Optional[str] = None, url: Optional[XsUri] = None,
74
72
self .committer = committer
75
73
self .message = message
76
74
77
- @property
75
+ @property # type: ignore[misc]
76
+ @serializable .xml_sequence (1 )
78
77
def uid (self ) -> Optional [str ]:
79
78
"""
80
79
A unique identifier of the commit. This may be version control specific. For example, Subversion uses revision
@@ -89,7 +88,8 @@ def uid(self) -> Optional[str]:
89
88
def uid (self , uid : Optional [str ]) -> None :
90
89
self ._uid = uid
91
90
92
- @property
91
+ @property # type: ignore[misc]
92
+ @serializable .xml_sequence (2 )
93
93
def url (self ) -> Optional [XsUri ]:
94
94
"""
95
95
The URL to the commit. This URL will typically point to a commit in a version control system.
@@ -103,7 +103,8 @@ def url(self) -> Optional[XsUri]:
103
103
def url (self , url : Optional [XsUri ]) -> None :
104
104
self ._url = url
105
105
106
- @property
106
+ @property # type: ignore[misc]
107
+ @serializable .xml_sequence (3 )
107
108
def author (self ) -> Optional [IdentifiableAction ]:
108
109
"""
109
110
The author who created the changes in the commit.
@@ -117,7 +118,8 @@ def author(self) -> Optional[IdentifiableAction]:
117
118
def author (self , author : Optional [IdentifiableAction ]) -> None :
118
119
self ._author = author
119
120
120
- @property
121
+ @property # type: ignore[misc]
122
+ @serializable .xml_sequence (4 )
121
123
def committer (self ) -> Optional [IdentifiableAction ]:
122
124
"""
123
125
The person who committed or pushed the commit
@@ -131,7 +133,8 @@ def committer(self) -> Optional[IdentifiableAction]:
131
133
def committer (self , committer : Optional [IdentifiableAction ]) -> None :
132
134
self ._committer = committer
133
135
134
- @property
136
+ @property # type: ignore[misc]
137
+ @serializable .xml_sequence (5 )
135
138
def message (self ) -> Optional [str ]:
136
139
"""
137
140
The text description of the contents of the commit.
@@ -378,7 +381,8 @@ def diff(self) -> Optional[Diff]:
378
381
def diff (self , diff : Optional [Diff ]) -> None :
379
382
self ._diff = diff
380
383
381
- @property
384
+ @property # type: ignore[misc]
385
+ @serializable .xml_array (serializable .XmlArraySerializationType .NESTED , 'issue' )
382
386
def resolves (self ) -> "SortedSet[IssueType]" :
383
387
"""
384
388
Optional list of issues resolved by this patch.
@@ -443,6 +447,7 @@ def __init__(self, *, ancestors: Optional[Iterable['Component']] = None,
443
447
444
448
@property # type: ignore[misc]
445
449
@serializable .xml_array (serializable .XmlArraySerializationType .NESTED , 'component' )
450
+ @serializable .xml_sequence (1 )
446
451
def ancestors (self ) -> "SortedSet['Component']" :
447
452
"""
448
453
Describes zero or more components in which a component is derived from. This is commonly used to describe forks
@@ -464,6 +469,7 @@ def ancestors(self, ancestors: Iterable['Component']) -> None:
464
469
465
470
@property # type: ignore[misc]
466
471
@serializable .xml_array (serializable .XmlArraySerializationType .NESTED , 'component' )
472
+ @serializable .xml_sequence (2 )
467
473
def descendants (self ) -> "SortedSet['Component']" :
468
474
"""
469
475
Descendants are the exact opposite of ancestors. This provides a way to document all forks (and their forks) of
@@ -480,6 +486,7 @@ def descendants(self, descendants: Iterable['Component']) -> None:
480
486
481
487
@property # type: ignore[misc]
482
488
@serializable .xml_array (serializable .XmlArraySerializationType .NESTED , 'component' )
489
+ @serializable .xml_sequence (3 )
483
490
def variants (self ) -> "SortedSet['Component']" :
484
491
"""
485
492
Variants describe relations where the relationship between the components are not known. For example, if
@@ -497,6 +504,7 @@ def variants(self, variants: Iterable['Component']) -> None:
497
504
498
505
@property # type: ignore[misc]
499
506
@serializable .xml_array (serializable .XmlArraySerializationType .NESTED , 'commit' )
507
+ @serializable .xml_sequence (4 )
500
508
def commits (self ) -> "SortedSet[Commit]" :
501
509
"""
502
510
A list of zero or more commits which provide a trail describing how the component deviates from an ancestor,
@@ -513,6 +521,7 @@ def commits(self, commits: Iterable[Commit]) -> None:
513
521
514
522
@property # type: ignore[misc]
515
523
@serializable .xml_array (serializable .XmlArraySerializationType .NESTED , 'patch' )
524
+ @serializable .xml_sequence (5 )
516
525
def patches (self ) -> "SortedSet[Patch]" :
517
526
"""
518
527
A list of zero or more patches describing how the component deviates from an ancestor, descendant, or variant.
@@ -527,7 +536,8 @@ def patches(self) -> "SortedSet[Patch]":
527
536
def patches (self , patches : Iterable [Patch ]) -> None :
528
537
self ._patches = SortedSet (patches )
529
538
530
- @property
539
+ @property # type: ignore[misc]
540
+ @serializable .xml_sequence (6 )
531
541
def notes (self ) -> Optional [str ]:
532
542
"""
533
543
Notes, observations, and other non-structured commentary describing the components pedigree.
0 commit comments