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

/// ReleaseAsset : Data related to a release.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ReleaseAsset {
    #[serde(rename = "browser_download_url")]
    pub browser_download_url: String,
    #[serde(rename = "content_type")]
    pub content_type: String,
    #[serde(rename = "created_at")]
    pub created_at: String,
    #[serde(rename = "download_count")]
    pub download_count: i32,
    #[serde(rename = "id")]
    pub id: i32,
    #[serde(rename = "label", deserialize_with = "Option::deserialize")]
    pub label: Option<String>,
    /// The file name of the asset.
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "node_id")]
    pub node_id: String,
    #[serde(rename = "size")]
    pub size: i32,
    /// State of the release asset.
    #[serde(rename = "state")]
    pub state: State,
    #[serde(rename = "updated_at")]
    pub updated_at: String,
    #[serde(rename = "uploader", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub uploader: Option<Option<Box<models::User>>>,
    #[serde(rename = "url")]
    pub url: String,
}

impl ReleaseAsset {
    /// Data related to a release.
    pub fn new(browser_download_url: String, content_type: String, created_at: String, download_count: i32, id: i32, label: Option<String>, name: String, node_id: String, size: i32, state: State, updated_at: String, url: String) -> ReleaseAsset {
        ReleaseAsset {
            browser_download_url,
            content_type,
            created_at,
            download_count,
            id,
            label,
            name,
            node_id,
            size,
            state,
            updated_at,
            uploader: None,
            url,
        }
    }
}
/// State of the release asset.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum State {
    #[serde(rename = "uploaded")]
    Uploaded,
}

impl Default for State {
    fn default() -> State {
        Self::Uploaded
    }
}