Skip to main content

provenant/output_schema/
license_clarity_score.rs

1// SPDX-FileCopyrightText: Provenant contributors
2// SPDX-License-Identifier: Apache-2.0
3
4use serde::{Deserialize, Serialize};
5
6#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
7pub struct OutputLicenseClarityScore {
8    pub score: usize,
9    pub declared_license: bool,
10    pub identification_precision: bool,
11    pub has_license_text: bool,
12    pub declared_copyrights: bool,
13    pub conflicting_license_categories: bool,
14    pub ambiguous_compound_licensing: bool,
15}
16
17impl From<&crate::models::LicenseClarityScore> for OutputLicenseClarityScore {
18    fn from(value: &crate::models::LicenseClarityScore) -> Self {
19        Self {
20            score: value.score,
21            declared_license: value.declared_license,
22            identification_precision: value.identification_precision,
23            has_license_text: value.has_license_text,
24            declared_copyrights: value.declared_copyrights,
25            conflicting_license_categories: value.conflicting_license_categories,
26            ambiguous_compound_licensing: value.ambiguous_compound_licensing,
27        }
28    }
29}