spdx_tools.spdx3.model.external_identifier
1# SPDX-FileCopyrightText: 2023 spdx contributors 2# 3# SPDX-License-Identifier: Apache-2.0 4from dataclasses import field 5from enum import Enum, auto 6 7from beartype.typing import List, Optional 8 9from spdx_tools.common.typing.dataclass_with_properties import dataclass_with_properties 10from spdx_tools.common.typing.type_checks import check_types_and_set_values 11 12 13class ExternalIdentifierType(Enum): 14 CPE22 = auto() 15 CPE23 = auto() 16 CVE = auto() 17 EMAIL = auto() 18 GITOID = auto() 19 PURL = auto() 20 SECURITY_OTHER = auto() 21 SWHID = auto() 22 SWID = auto() 23 URL_SCHEME = auto() 24 OTHER = auto() 25 26 27@dataclass_with_properties 28class ExternalIdentifier: 29 external_identifier_type: ExternalIdentifierType 30 identifier: str 31 comment: Optional[str] = None 32 identifier_locator: List[str] = field(default_factory=list) 33 issuing_authority: Optional[str] = None 34 35 def __init__( 36 self, 37 external_identifier_type: ExternalIdentifierType, 38 identifier: str, 39 comment: Optional[str] = None, 40 identifier_locator: List[str] = None, 41 issuing_authority: Optional[str] = None, 42 ): 43 identifier_locator = [] if identifier_locator is None else identifier_locator 44 check_types_and_set_values(self, locals())
class
ExternalIdentifierType(enum.Enum):
14class ExternalIdentifierType(Enum): 15 CPE22 = auto() 16 CPE23 = auto() 17 CVE = auto() 18 EMAIL = auto() 19 GITOID = auto() 20 PURL = auto() 21 SECURITY_OTHER = auto() 22 SWHID = auto() 23 SWID = auto() 24 URL_SCHEME = auto() 25 OTHER = auto()
CPE22 =
<ExternalIdentifierType.CPE22: 1>
CPE23 =
<ExternalIdentifierType.CPE23: 2>
CVE =
<ExternalIdentifierType.CVE: 3>
EMAIL =
<ExternalIdentifierType.EMAIL: 4>
GITOID =
<ExternalIdentifierType.GITOID: 5>
PURL =
<ExternalIdentifierType.PURL: 6>
SECURITY_OTHER =
<ExternalIdentifierType.SECURITY_OTHER: 7>
SWHID =
<ExternalIdentifierType.SWHID: 8>
SWID =
<ExternalIdentifierType.SWID: 9>
URL_SCHEME =
<ExternalIdentifierType.URL_SCHEME: 10>
OTHER =
<ExternalIdentifierType.OTHER: 11>
Inherited Members
- enum.Enum
- name
- value
@dataclass_with_properties
class
ExternalIdentifier:
28@dataclass_with_properties 29class ExternalIdentifier: 30 external_identifier_type: ExternalIdentifierType 31 identifier: str 32 comment: Optional[str] = None 33 identifier_locator: List[str] = field(default_factory=list) 34 issuing_authority: Optional[str] = None 35 36 def __init__( 37 self, 38 external_identifier_type: ExternalIdentifierType, 39 identifier: str, 40 comment: Optional[str] = None, 41 identifier_locator: List[str] = None, 42 issuing_authority: Optional[str] = None, 43 ): 44 identifier_locator = [] if identifier_locator is None else identifier_locator 45 check_types_and_set_values(self, locals())
ExternalIdentifier( external_identifier_type: ExternalIdentifierType, identifier: str, comment: Optional[str] = None, identifier_locator: list[str] = None, issuing_authority: Optional[str] = None)
36 def __init__( 37 self, 38 external_identifier_type: ExternalIdentifierType, 39 identifier: str, 40 comment: Optional[str] = None, 41 identifier_locator: List[str] = None, 42 issuing_authority: Optional[str] = None, 43 ): 44 identifier_locator = [] if identifier_locator is None else identifier_locator 45 check_types_and_set_values(self, locals())
external_identifier_type: ExternalIdentifierType