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
/*
* 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};
/// Snapshot : Create a new snapshot of a repository's dependencies.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Snapshot {
/// The version of the repository snapshot submission.
#[serde(rename = "version")]
pub version: i32,
#[serde(rename = "job")]
pub job: Box<models::SnapshotJob>,
/// The commit SHA associated with this dependency snapshot. Maximum length: 40 characters.
#[serde(rename = "sha")]
pub sha: String,
/// The repository branch that triggered this snapshot.
#[serde(rename = "ref")]
pub r#ref: String,
#[serde(rename = "detector")]
pub detector: Box<models::SnapshotDetector>,
/// 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 collection of package manifests, which are a collection of related dependencies declared in a file or representing a logical group of dependencies.
#[serde(rename = "manifests", skip_serializing_if = "Option::is_none")]
pub manifests: Option<std::collections::HashMap<String, models::Manifest>>,
/// The time at which the snapshot was scanned.
#[serde(rename = "scanned")]
pub scanned: String,
}
impl Snapshot {
/// Create a new snapshot of a repository's dependencies.
pub fn new(version: i32, job: models::SnapshotJob, sha: String, r#ref: String, detector: models::SnapshotDetector, scanned: String) -> Snapshot {
Snapshot {
version,
job: Box::new(job),
sha,
r#ref,
detector: Box::new(detector),
metadata: None,
manifests: None,
scanned,
}
}
}