Total Complexity | 1 |
Total Lines | 30 |
Duplicated Lines | 0 % |
Coverage | 93.33% |
Changes | 0 |
1 | # Copyright 2022, Red Hat, Inc. |
||
2 | # SPDX-License-Identifier: LGPL-2.1-or-later |
||
3 | |||
4 | 1 | from typing import List |
|
5 | |||
6 | 1 | from openscap_report.dataclasses import asdict, dataclass, field |
|
7 | |||
8 | 1 | from .oval_node import OvalNode |
|
9 | 1 | from .oval_reference import OvalReference |
|
10 | |||
11 | 1 | OVAL_DEFINITION_JSON_KEYS = [ |
|
12 | "definition_id", |
||
13 | "title", |
||
14 | "description", |
||
15 | "version", |
||
16 | ] |
||
17 | |||
18 | |||
19 | 1 | @dataclass |
|
20 | 1 | class OvalDefinition: |
|
21 | 1 | definition_id: str |
|
22 | 1 | title: str |
|
23 | 1 | description: str = "" |
|
24 | 1 | version: str = "" |
|
25 | 1 | references: List[OvalReference] = field(default_factory=list) |
|
26 | 1 | oval_tree: OvalNode = None |
|
27 | |||
28 | 1 | def as_dict(self): |
|
29 | return asdict(self) |
||
30 |