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

/// WebhooksRelease : The [release](https://docs.github.com/rest/releases/releases/#get-a-release) object.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct WebhooksRelease {
    #[serde(rename = "assets")]
    pub assets: Vec<models::ReleaseAsset>,
    #[serde(rename = "assets_url")]
    pub assets_url: String,
    #[serde(rename = "author", deserialize_with = "Option::deserialize")]
    pub author: Option<Box<models::User>>,
    #[serde(rename = "body", deserialize_with = "Option::deserialize")]
    pub body: Option<String>,
    #[serde(rename = "created_at", deserialize_with = "Option::deserialize")]
    pub created_at: Option<String>,
    #[serde(rename = "discussion_url", skip_serializing_if = "Option::is_none")]
    pub discussion_url: Option<String>,
    /// Whether the release is a draft or published
    #[serde(rename = "draft")]
    pub draft: bool,
    #[serde(rename = "html_url")]
    pub html_url: String,
    #[serde(rename = "id")]
    pub id: i32,
    #[serde(rename = "name", deserialize_with = "Option::deserialize")]
    pub name: Option<String>,
    #[serde(rename = "node_id")]
    pub node_id: String,
    /// Whether the release is identified as a prerelease or a full release.
    #[serde(rename = "prerelease")]
    pub prerelease: bool,
    #[serde(rename = "published_at", deserialize_with = "Option::deserialize")]
    pub published_at: Option<String>,
    #[serde(rename = "reactions", skip_serializing_if = "Option::is_none")]
    pub reactions: Option<Box<models::Reactions>>,
    /// The name of the tag.
    #[serde(rename = "tag_name")]
    pub tag_name: String,
    #[serde(rename = "tarball_url", deserialize_with = "Option::deserialize")]
    pub tarball_url: Option<String>,
    /// Specifies the commitish value that determines where the Git tag is created from.
    #[serde(rename = "target_commitish")]
    pub target_commitish: String,
    #[serde(rename = "upload_url")]
    pub upload_url: String,
    #[serde(rename = "url")]
    pub url: String,
    #[serde(rename = "zipball_url", deserialize_with = "Option::deserialize")]
    pub zipball_url: Option<String>,
}

impl WebhooksRelease {
    /// The [release](https://docs.github.com/rest/releases/releases/#get-a-release) object.
    pub fn new(assets: Vec<models::ReleaseAsset>, assets_url: String, author: Option<models::User>, body: Option<String>, created_at: Option<String>, draft: bool, html_url: String, id: i32, name: Option<String>, node_id: String, prerelease: bool, published_at: Option<String>, tag_name: String, tarball_url: Option<String>, target_commitish: String, upload_url: String, url: String, zipball_url: Option<String>) -> WebhooksRelease {
        WebhooksRelease {
            assets,
            assets_url,
            author: author.map(Box::new),
            body,
            created_at,
            discussion_url: None,
            draft,
            html_url,
            id,
            name,
            node_id,
            prerelease,
            published_at,
            reactions: None,
            tag_name,
            tarball_url,
            target_commitish,
            upload_url,
            url,
            zipball_url,
        }
    }
}