openapi_github/models/
dependency_graph_diff_inner.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 DependencyGraphDiffInner {
16    #[serde(rename = "change_type")]
17    pub change_type: ChangeType,
18    #[serde(rename = "manifest")]
19    pub manifest: String,
20    #[serde(rename = "ecosystem")]
21    pub ecosystem: String,
22    #[serde(rename = "name")]
23    pub name: String,
24    #[serde(rename = "version")]
25    pub version: String,
26    #[serde(rename = "package_url", deserialize_with = "Option::deserialize")]
27    pub package_url: Option<String>,
28    #[serde(rename = "license", deserialize_with = "Option::deserialize")]
29    pub license: Option<String>,
30    #[serde(rename = "source_repository_url", deserialize_with = "Option::deserialize")]
31    pub source_repository_url: Option<String>,
32    #[serde(rename = "vulnerabilities")]
33    pub vulnerabilities: Vec<models::DependencyGraphDiffInnerVulnerabilitiesInner>,
34    /// Where the dependency is utilized. `development` means that the dependency is only utilized in the development environment. `runtime` means that the dependency is utilized at runtime and in the development environment.
35    #[serde(rename = "scope")]
36    pub scope: Scope,
37}
38
39impl DependencyGraphDiffInner {
40    pub fn new(change_type: ChangeType, manifest: String, ecosystem: String, name: String, version: String, package_url: Option<String>, license: Option<String>, source_repository_url: Option<String>, vulnerabilities: Vec<models::DependencyGraphDiffInnerVulnerabilitiesInner>, scope: Scope) -> DependencyGraphDiffInner {
41        DependencyGraphDiffInner {
42            change_type,
43            manifest,
44            ecosystem,
45            name,
46            version,
47            package_url,
48            license,
49            source_repository_url,
50            vulnerabilities,
51            scope,
52        }
53    }
54}
55/// 
56#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
57pub enum ChangeType {
58    #[serde(rename = "added")]
59    Added,
60    #[serde(rename = "removed")]
61    Removed,
62}
63
64impl Default for ChangeType {
65    fn default() -> ChangeType {
66        Self::Added
67    }
68}
69/// Where the dependency is utilized. `development` means that the dependency is only utilized in the development environment. `runtime` means that the dependency is utilized at runtime and in the development environment.
70#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
71pub enum Scope {
72    #[serde(rename = "unknown")]
73    Unknown,
74    #[serde(rename = "runtime")]
75    Runtime,
76    #[serde(rename = "development")]
77    Development,
78}
79
80impl Default for Scope {
81    fn default() -> Scope {
82        Self::Unknown
83    }
84}
85