openapi_github/models/
dependency.rs

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