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

/// Package : A software package
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Package {
    /// Unique identifier of the package.
    #[serde(rename = "id")]
    pub id: i32,
    /// The name of the package.
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "package_type")]
    pub package_type: PackageType,
    #[serde(rename = "url")]
    pub url: String,
    #[serde(rename = "html_url")]
    pub html_url: String,
    /// The number of versions of the package.
    #[serde(rename = "version_count")]
    pub version_count: i32,
    #[serde(rename = "visibility")]
    pub visibility: Visibility,
    #[serde(rename = "owner", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub owner: Option<Option<Box<models::NullableSimpleUser>>>,
    #[serde(rename = "repository", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub repository: Option<Option<Box<models::NullableMinimalRepository>>>,
    #[serde(rename = "created_at")]
    pub created_at: String,
    #[serde(rename = "updated_at")]
    pub updated_at: String,
}

impl Package {
    /// A software package
    pub fn new(id: i32, name: String, package_type: PackageType, url: String, html_url: String, version_count: i32, visibility: Visibility, created_at: String, updated_at: String) -> Package {
        Package {
            id,
            name,
            package_type,
            url,
            html_url,
            version_count,
            visibility,
            owner: None,
            repository: None,
            created_at,
            updated_at,
        }
    }
}
/// 
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum PackageType {
    #[serde(rename = "npm")]
    Npm,
    #[serde(rename = "maven")]
    Maven,
    #[serde(rename = "rubygems")]
    Rubygems,
    #[serde(rename = "docker")]
    Docker,
    #[serde(rename = "nuget")]
    Nuget,
    #[serde(rename = "container")]
    Container,
}

impl Default for PackageType {
    fn default() -> PackageType {
        Self::Npm
    }
}
/// 
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Visibility {
    #[serde(rename = "private")]
    Private,
    #[serde(rename = "public")]
    Public,
}

impl Default for Visibility {
    fn default() -> Visibility {
        Self::Private
    }
}