openapi_github/models/
snapshot_job.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 SnapshotJob {
16    /// The external ID of the job.
17    #[serde(rename = "id")]
18    pub id: String,
19    /// Correlator provides a key that is used to group snapshots submitted over time. Only the \"latest\" submitted snapshot for a given combination of `job.correlator` and `detector.name` will be considered when calculating a repository's current dependencies. Correlator should be as unique as it takes to distinguish all detection runs for a given \"wave\" of CI workflow you run. If you're using GitHub Actions, a good default value for this could be the environment variables GITHUB_WORKFLOW and GITHUB_JOB concatenated together. If you're using a build matrix, then you'll also need to add additional key(s) to distinguish between each submission inside a matrix variation.
20    #[serde(rename = "correlator")]
21    pub correlator: String,
22    /// The url for the job.
23    #[serde(rename = "html_url", skip_serializing_if = "Option::is_none")]
24    pub html_url: Option<String>,
25}
26
27impl SnapshotJob {
28    pub fn new(id: String, correlator: String) -> SnapshotJob {
29        SnapshotJob {
30            id,
31            correlator,
32            html_url: None,
33        }
34    }
35}
36