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};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct DependencyGraphDiffInner {
    #[serde(rename = "change_type")]
    pub change_type: ChangeType,
    #[serde(rename = "manifest")]
    pub manifest: String,
    #[serde(rename = "ecosystem")]
    pub ecosystem: String,
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "version")]
    pub version: String,
    #[serde(rename = "package_url", deserialize_with = "Option::deserialize")]
    pub package_url: Option<String>,
    #[serde(rename = "license", deserialize_with = "Option::deserialize")]
    pub license: Option<String>,
    #[serde(rename = "source_repository_url", deserialize_with = "Option::deserialize")]
    pub source_repository_url: Option<String>,
    #[serde(rename = "vulnerabilities")]
    pub vulnerabilities: Vec<models::DependencyGraphDiffInnerVulnerabilitiesInner>,
    /// 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.
    #[serde(rename = "scope")]
    pub scope: Scope,
}

impl DependencyGraphDiffInner {
    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 {
        DependencyGraphDiffInner {
            change_type,
            manifest,
            ecosystem,
            name,
            version,
            package_url,
            license,
            source_repository_url,
            vulnerabilities,
            scope,
        }
    }
}
/// 
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum ChangeType {
    #[serde(rename = "added")]
    Added,
    #[serde(rename = "removed")]
    Removed,
}

impl Default for ChangeType {
    fn default() -> ChangeType {
        Self::Added
    }
}
/// 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.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Scope {
    #[serde(rename = "unknown")]
    Unknown,
    #[serde(rename = "runtime")]
    Runtime,
    #[serde(rename = "development")]
    Development,
}

impl Default for Scope {
    fn default() -> Scope {
        Self::Unknown
    }
}