Skip to main content

provenant/license_detection/models/
license.rs

1// SPDX-FileCopyrightText: nexB Inc. and others
2// SPDX-FileCopyrightText: Provenant contributors
3// SPDX-License-Identifier: Apache-2.0
4// Derived from ScanCode Toolkit (Apache-2.0); modified. See NOTICE.
5
6//! License metadata loaded from .LICENSE files.
7
8use rkyv::Archive;
9use serde::{Deserialize, Serialize};
10
11/// License metadata loaded from .LICENSE files.
12#[derive(
13    Debug,
14    Clone,
15    PartialEq,
16    Default,
17    Serialize,
18    Deserialize,
19    Archive,
20    rkyv::Serialize,
21    rkyv::Deserialize,
22)]
23pub struct License {
24    pub key: String,
25    pub short_name: Option<String>,
26    pub name: String,
27    pub language: Option<String>,
28    pub spdx_license_key: Option<String>,
29    pub other_spdx_license_keys: Vec<String>,
30    pub category: Option<String>,
31    pub owner: Option<String>,
32    pub homepage_url: Option<String>,
33    pub text: String,
34    pub reference_urls: Vec<String>,
35    pub osi_license_key: Option<String>,
36    pub text_urls: Vec<String>,
37    pub osi_url: Option<String>,
38    pub faq_url: Option<String>,
39    pub other_urls: Vec<String>,
40    pub notes: Option<String>,
41    pub is_deprecated: bool,
42    pub is_exception: bool,
43    pub is_unknown: bool,
44    pub is_generic: bool,
45    pub replaced_by: Vec<String>,
46    pub minimum_coverage: Option<u8>,
47    pub standard_notice: Option<String>,
48    pub ignorable_copyrights: Option<Vec<String>>,
49    pub ignorable_holders: Option<Vec<String>>,
50    pub ignorable_authors: Option<Vec<String>>,
51    pub ignorable_urls: Option<Vec<String>>,
52    pub ignorable_emails: Option<Vec<String>>,
53}