spdx_tools.spdx.model.relationship
1# SPDX-FileCopyrightText: 2022 spdx contributors 2# 3# SPDX-License-Identifier: Apache-2.0 4from enum import Enum, auto 5 6from beartype.typing import Optional, Union 7 8from spdx_tools.common.typing.dataclass_with_properties import dataclass_with_properties 9from spdx_tools.common.typing.type_checks import check_types_and_set_values 10from spdx_tools.spdx.model import SpdxNoAssertion, SpdxNone 11 12 13class RelationshipType(Enum): 14 AMENDS = auto() 15 ANCESTOR_OF = auto() 16 BUILD_DEPENDENCY_OF = auto() 17 BUILD_TOOL_OF = auto() 18 CONTAINED_BY = auto() 19 CONTAINS = auto() 20 COPY_OF = auto() 21 DATA_FILE_OF = auto() 22 DEPENDENCY_MANIFEST_OF = auto() 23 DEPENDENCY_OF = auto() 24 DEPENDS_ON = auto() 25 DESCENDANT_OF = auto() 26 DESCRIBED_BY = auto() 27 DESCRIBES = auto() 28 DEV_DEPENDENCY_OF = auto() 29 DEV_TOOL_OF = auto() 30 DISTRIBUTION_ARTIFACT = auto() 31 DOCUMENTATION_OF = auto() 32 DYNAMIC_LINK = auto() 33 EXAMPLE_OF = auto() 34 EXPANDED_FROM_ARCHIVE = auto() 35 FILE_ADDED = auto() 36 FILE_DELETED = auto() 37 FILE_MODIFIED = auto() 38 GENERATED_FROM = auto() 39 GENERATES = auto() 40 HAS_PREREQUISITE = auto() 41 METAFILE_OF = auto() 42 OPTIONAL_COMPONENT_OF = auto() 43 OPTIONAL_DEPENDENCY_OF = auto() 44 OTHER = auto() 45 PACKAGE_OF = auto() 46 PATCH_APPLIED = auto() 47 PATCH_FOR = auto() 48 PREREQUISITE_FOR = auto() 49 PROVIDED_DEPENDENCY_OF = auto() 50 REQUIREMENT_DESCRIPTION_FOR = auto() 51 RUNTIME_DEPENDENCY_OF = auto() 52 SPECIFICATION_FOR = auto() 53 STATIC_LINK = auto() 54 TEST_CASE_OF = auto() 55 TEST_DEPENDENCY_OF = auto() 56 TEST_OF = auto() 57 TEST_TOOL_OF = auto() 58 VARIANT_OF = auto() 59 60 61@dataclass_with_properties 62class Relationship: 63 spdx_element_id: str 64 relationship_type: RelationshipType 65 related_spdx_element_id: Union[str, SpdxNone, SpdxNoAssertion] 66 comment: Optional[str] = None 67 68 def __init__( 69 self, 70 spdx_element_id: str, 71 relationship_type: RelationshipType, 72 related_spdx_element_id: Union[str, SpdxNone, SpdxNoAssertion], 73 comment: Optional[str] = None, 74 ): 75 check_types_and_set_values(self, locals())
class
RelationshipType(enum.Enum):
14class RelationshipType(Enum): 15 AMENDS = auto() 16 ANCESTOR_OF = auto() 17 BUILD_DEPENDENCY_OF = auto() 18 BUILD_TOOL_OF = auto() 19 CONTAINED_BY = auto() 20 CONTAINS = auto() 21 COPY_OF = auto() 22 DATA_FILE_OF = auto() 23 DEPENDENCY_MANIFEST_OF = auto() 24 DEPENDENCY_OF = auto() 25 DEPENDS_ON = auto() 26 DESCENDANT_OF = auto() 27 DESCRIBED_BY = auto() 28 DESCRIBES = auto() 29 DEV_DEPENDENCY_OF = auto() 30 DEV_TOOL_OF = auto() 31 DISTRIBUTION_ARTIFACT = auto() 32 DOCUMENTATION_OF = auto() 33 DYNAMIC_LINK = auto() 34 EXAMPLE_OF = auto() 35 EXPANDED_FROM_ARCHIVE = auto() 36 FILE_ADDED = auto() 37 FILE_DELETED = auto() 38 FILE_MODIFIED = auto() 39 GENERATED_FROM = auto() 40 GENERATES = auto() 41 HAS_PREREQUISITE = auto() 42 METAFILE_OF = auto() 43 OPTIONAL_COMPONENT_OF = auto() 44 OPTIONAL_DEPENDENCY_OF = auto() 45 OTHER = auto() 46 PACKAGE_OF = auto() 47 PATCH_APPLIED = auto() 48 PATCH_FOR = auto() 49 PREREQUISITE_FOR = auto() 50 PROVIDED_DEPENDENCY_OF = auto() 51 REQUIREMENT_DESCRIPTION_FOR = auto() 52 RUNTIME_DEPENDENCY_OF = auto() 53 SPECIFICATION_FOR = auto() 54 STATIC_LINK = auto() 55 TEST_CASE_OF = auto() 56 TEST_DEPENDENCY_OF = auto() 57 TEST_OF = auto() 58 TEST_TOOL_OF = auto() 59 VARIANT_OF = auto()
AMENDS =
<RelationshipType.AMENDS: 1>
ANCESTOR_OF =
<RelationshipType.ANCESTOR_OF: 2>
BUILD_DEPENDENCY_OF =
<RelationshipType.BUILD_DEPENDENCY_OF: 3>
BUILD_TOOL_OF =
<RelationshipType.BUILD_TOOL_OF: 4>
CONTAINED_BY =
<RelationshipType.CONTAINED_BY: 5>
CONTAINS =
<RelationshipType.CONTAINS: 6>
COPY_OF =
<RelationshipType.COPY_OF: 7>
DATA_FILE_OF =
<RelationshipType.DATA_FILE_OF: 8>
DEPENDENCY_MANIFEST_OF =
<RelationshipType.DEPENDENCY_MANIFEST_OF: 9>
DEPENDENCY_OF =
<RelationshipType.DEPENDENCY_OF: 10>
DEPENDS_ON =
<RelationshipType.DEPENDS_ON: 11>
DESCENDANT_OF =
<RelationshipType.DESCENDANT_OF: 12>
DESCRIBED_BY =
<RelationshipType.DESCRIBED_BY: 13>
DESCRIBES =
<RelationshipType.DESCRIBES: 14>
DEV_DEPENDENCY_OF =
<RelationshipType.DEV_DEPENDENCY_OF: 15>
DEV_TOOL_OF =
<RelationshipType.DEV_TOOL_OF: 16>
DISTRIBUTION_ARTIFACT =
<RelationshipType.DISTRIBUTION_ARTIFACT: 17>
DOCUMENTATION_OF =
<RelationshipType.DOCUMENTATION_OF: 18>
DYNAMIC_LINK =
<RelationshipType.DYNAMIC_LINK: 19>
EXAMPLE_OF =
<RelationshipType.EXAMPLE_OF: 20>
EXPANDED_FROM_ARCHIVE =
<RelationshipType.EXPANDED_FROM_ARCHIVE: 21>
FILE_ADDED =
<RelationshipType.FILE_ADDED: 22>
FILE_DELETED =
<RelationshipType.FILE_DELETED: 23>
FILE_MODIFIED =
<RelationshipType.FILE_MODIFIED: 24>
GENERATED_FROM =
<RelationshipType.GENERATED_FROM: 25>
GENERATES =
<RelationshipType.GENERATES: 26>
HAS_PREREQUISITE =
<RelationshipType.HAS_PREREQUISITE: 27>
METAFILE_OF =
<RelationshipType.METAFILE_OF: 28>
OPTIONAL_COMPONENT_OF =
<RelationshipType.OPTIONAL_COMPONENT_OF: 29>
OPTIONAL_DEPENDENCY_OF =
<RelationshipType.OPTIONAL_DEPENDENCY_OF: 30>
OTHER =
<RelationshipType.OTHER: 31>
PACKAGE_OF =
<RelationshipType.PACKAGE_OF: 32>
PATCH_APPLIED =
<RelationshipType.PATCH_APPLIED: 33>
PATCH_FOR =
<RelationshipType.PATCH_FOR: 34>
PREREQUISITE_FOR =
<RelationshipType.PREREQUISITE_FOR: 35>
PROVIDED_DEPENDENCY_OF =
<RelationshipType.PROVIDED_DEPENDENCY_OF: 36>
REQUIREMENT_DESCRIPTION_FOR =
<RelationshipType.REQUIREMENT_DESCRIPTION_FOR: 37>
RUNTIME_DEPENDENCY_OF =
<RelationshipType.RUNTIME_DEPENDENCY_OF: 38>
SPECIFICATION_FOR =
<RelationshipType.SPECIFICATION_FOR: 39>
STATIC_LINK =
<RelationshipType.STATIC_LINK: 40>
TEST_CASE_OF =
<RelationshipType.TEST_CASE_OF: 41>
TEST_DEPENDENCY_OF =
<RelationshipType.TEST_DEPENDENCY_OF: 42>
TEST_OF =
<RelationshipType.TEST_OF: 43>
TEST_TOOL_OF =
<RelationshipType.TEST_TOOL_OF: 44>
VARIANT_OF =
<RelationshipType.VARIANT_OF: 45>
Inherited Members
- enum.Enum
- name
- value
@dataclass_with_properties
class
Relationship:
62@dataclass_with_properties 63class Relationship: 64 spdx_element_id: str 65 relationship_type: RelationshipType 66 related_spdx_element_id: Union[str, SpdxNone, SpdxNoAssertion] 67 comment: Optional[str] = None 68 69 def __init__( 70 self, 71 spdx_element_id: str, 72 relationship_type: RelationshipType, 73 related_spdx_element_id: Union[str, SpdxNone, SpdxNoAssertion], 74 comment: Optional[str] = None, 75 ): 76 check_types_and_set_values(self, locals())
Relationship( spdx_element_id: str, relationship_type: RelationshipType, related_spdx_element_id: Union[str, spdx_tools.spdx.model.spdx_none.SpdxNone, spdx_tools.spdx.model.spdx_no_assertion.SpdxNoAssertion], comment: Optional[str] = None)
relationship_type: RelationshipType