|
29 | 29 | from .._internal.bom_ref import bom_ref_from_str as _bom_ref_from_str
|
30 | 30 | from .._internal.compare import ComparablePackageURL as _ComparablePackageURL, ComparableTuple as _ComparableTuple
|
31 | 31 | from .._internal.hash import file_sha1sum as _file_sha1sum
|
32 |
| -from ..exception.model import InvalidOmniBorIdException, InvalidSwhidException, NoPropertiesProvidedException |
| 32 | +from ..exception.model import InvalidOmniBorIdException, InvalidSwhidException |
33 | 33 | from ..exception.serialization import (
|
34 | 34 | CycloneDxDeserializationException,
|
35 | 35 | SerializationOfUnexpectedValueException,
|
@@ -82,11 +82,6 @@ def __init__(
|
82 | 82 | committer: Optional[IdentifiableAction] = None,
|
83 | 83 | message: Optional[str] = None,
|
84 | 84 | ) -> None:
|
85 |
| - if not uid and not url and not author and not committer and not message: |
86 |
| - raise NoPropertiesProvidedException( |
87 |
| - 'At least one of `uid`, `url`, `author`, `committer` or `message` must be provided for a `Commit`.' |
88 |
| - ) |
89 |
| - |
90 | 85 | self.uid = uid
|
91 | 86 | self.url = url
|
92 | 87 | self.author = author
|
@@ -208,11 +203,6 @@ def __init__(
|
208 | 203 | licenses: Optional[Iterable[License]] = None,
|
209 | 204 | copyright: Optional[Iterable[Copyright]] = None,
|
210 | 205 | ) -> None:
|
211 |
| - if not licenses and not copyright: |
212 |
| - raise NoPropertiesProvidedException( |
213 |
| - 'At least one of `licenses` or `copyright` must be supplied for a `ComponentEvidence`.' |
214 |
| - ) |
215 |
| - |
216 | 206 | self.licenses = licenses or [] # type:ignore[assignment]
|
217 | 207 | self.copyright = copyright or [] # type:ignore[assignment]
|
218 | 208 |
|
@@ -442,11 +432,6 @@ def __init__(
|
442 | 432 | text: Optional[AttachedText] = None,
|
443 | 433 | url: Optional[XsUri] = None,
|
444 | 434 | ) -> None:
|
445 |
| - if not text and not url: |
446 |
| - raise NoPropertiesProvidedException( |
447 |
| - 'At least one of `text` or `url` must be provided for a `Diff`.' |
448 |
| - ) |
449 |
| - |
450 | 435 | self.text = text
|
451 | 436 | self.url = url
|
452 | 437 |
|
@@ -624,12 +609,6 @@ def __init__(
|
624 | 609 | patches: Optional[Iterable[Patch]] = None,
|
625 | 610 | notes: Optional[str] = None,
|
626 | 611 | ) -> None:
|
627 |
| - if not ancestors and not descendants and not variants and not commits and not patches and not notes: |
628 |
| - raise NoPropertiesProvidedException( |
629 |
| - 'At least one of `ancestors`, `descendants`, `variants`, `commits`, `patches` or `notes` must be ' |
630 |
| - 'provided for `Pedigree`' |
631 |
| - ) |
632 |
| - |
633 | 612 | self.ancestors = ancestors or [] # type:ignore[assignment]
|
634 | 613 | self.descendants = descendants or [] # type:ignore[assignment]
|
635 | 614 | self.variants = variants or [] # type:ignore[assignment]
|
|
0 commit comments