1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/*
* GitHub's official OpenAPI spec + Octokit extension
*
* OpenAPI specs from https://github.com/github/rest-api-description with the 'x-octokit' extension required by the Octokit SDKs
*
* The version of the OpenAPI document: 16.6.0
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Dependency {
/// Package-url (PURL) of dependency. See https://github.com/package-url/purl-spec for more details.
#[serde(rename = "package_url", skip_serializing_if = "Option::is_none")]
pub package_url: Option<String>,
/// User-defined metadata to store domain-specific information limited to 8 keys with scalar values.
#[serde(rename = "metadata", skip_serializing_if = "Option::is_none")]
pub metadata: Option<std::collections::HashMap<String, models::MetadataValue>>,
/// A notation of whether a dependency is requested directly by this manifest or is a dependency of another dependency.
#[serde(rename = "relationship", skip_serializing_if = "Option::is_none")]
pub relationship: Option<Relationship>,
/// A notation of whether the dependency is required for the primary build artifact (runtime) or is only used for development. Future versions of this specification may allow for more granular scopes.
#[serde(rename = "scope", skip_serializing_if = "Option::is_none")]
pub scope: Option<Scope>,
/// Array of package-url (PURLs) of direct child dependencies.
#[serde(rename = "dependencies", skip_serializing_if = "Option::is_none")]
pub dependencies: Option<Vec<String>>,
}
impl Dependency {
pub fn new() -> Dependency {
Dependency {
package_url: None,
metadata: None,
relationship: None,
scope: None,
dependencies: None,
}
}
}
/// A notation of whether a dependency is requested directly by this manifest or is a dependency of another dependency.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Relationship {
#[serde(rename = "direct")]
Direct,
#[serde(rename = "indirect")]
Indirect,
}
impl Default for Relationship {
fn default() -> Relationship {
Self::Direct
}
}
/// A notation of whether the dependency is required for the primary build artifact (runtime) or is only used for development. Future versions of this specification may allow for more granular scopes.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Scope {
#[serde(rename = "runtime")]
Runtime,
#[serde(rename = "development")]
Development,
}
impl Default for Scope {
fn default() -> Scope {
Self::Runtime
}
}