spdx_tools.spdx3.model.software.software_artifact

 1# SPDX-FileCopyrightText: 2023 spdx contributors
 2#
 3# SPDX-License-Identifier: Apache-2.0
 4from abc import abstractmethod
 5from dataclasses import field
 6
 7from beartype.typing import List, Optional
 8
 9from spdx_tools.common.typing.dataclass_with_properties import dataclass_with_properties
10from spdx_tools.spdx3.model import Artifact
11from spdx_tools.spdx3.model.licensing import LicenseField
12from spdx_tools.spdx3.model.software import SoftwarePurpose
13
14
15@dataclass_with_properties
16class SoftwareArtifact(Artifact):
17    content_identifier: Optional[str] = None
18    primary_purpose: Optional[SoftwarePurpose] = None
19    additional_purpose: List[SoftwarePurpose] = field(default_factory=list)
20    concluded_license: Optional[LicenseField] = None
21    declared_license: Optional[LicenseField] = None
22    copyright_text: Optional[str] = None
23    attribution_text: Optional[str] = None
24
25    @abstractmethod
26    def __init__(self):
27        pass
@dataclass_with_properties
class SoftwareArtifact(spdx_tools.spdx3.model.artifact.Artifact):
16@dataclass_with_properties
17class SoftwareArtifact(Artifact):
18    content_identifier: Optional[str] = None
19    primary_purpose: Optional[SoftwarePurpose] = None
20    additional_purpose: List[SoftwarePurpose] = field(default_factory=list)
21    concluded_license: Optional[LicenseField] = None
22    declared_license: Optional[LicenseField] = None
23    copyright_text: Optional[str] = None
24    attribution_text: Optional[str] = None
25
26    @abstractmethod
27    def __init__(self):
28        pass
content_identifier: Optional[str]
47    def get_field(self) -> field_type:
48        return getattr(self, f"_{field_name}")
47    def get_field(self) -> field_type:
48        return getattr(self, f"_{field_name}")
47    def get_field(self) -> field_type:
48        return getattr(self, f"_{field_name}")
concluded_license: Optional[spdx_tools.spdx3.model.licensing.license_field.LicenseField]
47    def get_field(self) -> field_type:
48        return getattr(self, f"_{field_name}")
declared_license: Optional[spdx_tools.spdx3.model.licensing.license_field.LicenseField]
47    def get_field(self) -> field_type:
48        return getattr(self, f"_{field_name}")
copyright_text: Optional[str]
47    def get_field(self) -> field_type:
48        return getattr(self, f"_{field_name}")
attribution_text: Optional[str]
47    def get_field(self) -> field_type:
48        return getattr(self, f"_{field_name}")