spdx_tools.spdx3.model.external_map

 1# SPDX-FileCopyrightText: 2023 spdx contributors
 2#
 3# SPDX-License-Identifier: Apache-2.0
 4from dataclasses import field
 5
 6from beartype.typing import List, Optional
 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.spdx3.model import IntegrityMethod
11
12
13@dataclass_with_properties
14class ExternalMap:
15    external_id: str  # anyURI
16    verified_using: List[IntegrityMethod] = field(default_factory=list)
17    location_hint: Optional[str] = None  # anyURI
18    defining_document: Optional[str] = None
19
20    def __init__(
21        self,
22        external_id: str,
23        verified_using: List[IntegrityMethod] = None,
24        location_hint: Optional[str] = None,
25        defining_document: Optional[str] = None,
26    ):
27        verified_using = [] if verified_using is None else verified_using
28        check_types_and_set_values(self, locals())
@dataclass_with_properties
class ExternalMap:
14@dataclass_with_properties
15class ExternalMap:
16    external_id: str  # anyURI
17    verified_using: List[IntegrityMethod] = field(default_factory=list)
18    location_hint: Optional[str] = None  # anyURI
19    defining_document: Optional[str] = None
20
21    def __init__(
22        self,
23        external_id: str,
24        verified_using: List[IntegrityMethod] = None,
25        location_hint: Optional[str] = None,
26        defining_document: Optional[str] = None,
27    ):
28        verified_using = [] if verified_using is None else verified_using
29        check_types_and_set_values(self, locals())
ExternalMap( external_id: str, verified_using: list[spdx_tools.spdx3.model.integrity_method.IntegrityMethod] = None, location_hint: Optional[str] = None, defining_document: Optional[str] = None)
21    def __init__(
22        self,
23        external_id: str,
24        verified_using: List[IntegrityMethod] = None,
25        location_hint: Optional[str] = None,
26        defining_document: Optional[str] = None,
27    ):
28        verified_using = [] if verified_using is None else verified_using
29        check_types_and_set_values(self, locals())
external_id: 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}")
location_hint: Optional[str]
47    def get_field(self) -> field_type:
48        return getattr(self, f"_{field_name}")
defining_document: Optional[str]
47    def get_field(self) -> field_type:
48        return getattr(self, f"_{field_name}")