openapi-github 0.1.0

OpenAPI specs from https://github.com/github/rest-api-description with the 'x-octokit' extension required by the Octokit SDKs
Documentation
/*
 * 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,
        }
    }
}