openapi_github/models/
webhooks_release.rs

1/*
2 * GitHub's official OpenAPI spec + Octokit extension
3 *
4 * OpenAPI specs from https://github.com/github/rest-api-description with the 'x-octokit' extension required by the Octokit SDKs
5 *
6 * The version of the OpenAPI document: 16.6.0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// WebhooksRelease : The [release](https://docs.github.com/rest/releases/releases/#get-a-release) object.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct WebhooksRelease {
17    #[serde(rename = "assets")]
18    pub assets: Vec<models::ReleaseAsset>,
19    #[serde(rename = "assets_url")]
20    pub assets_url: String,
21    #[serde(rename = "author", deserialize_with = "Option::deserialize")]
22    pub author: Option<Box<models::User>>,
23    #[serde(rename = "body", deserialize_with = "Option::deserialize")]
24    pub body: Option<String>,
25    #[serde(rename = "created_at", deserialize_with = "Option::deserialize")]
26    pub created_at: Option<String>,
27    #[serde(rename = "discussion_url", skip_serializing_if = "Option::is_none")]
28    pub discussion_url: Option<String>,
29    /// Whether the release is a draft or published
30    #[serde(rename = "draft")]
31    pub draft: bool,
32    #[serde(rename = "html_url")]
33    pub html_url: String,
34    #[serde(rename = "id")]
35    pub id: i32,
36    #[serde(rename = "name", deserialize_with = "Option::deserialize")]
37    pub name: Option<String>,
38    #[serde(rename = "node_id")]
39    pub node_id: String,
40    /// Whether the release is identified as a prerelease or a full release.
41    #[serde(rename = "prerelease")]
42    pub prerelease: bool,
43    #[serde(rename = "published_at", deserialize_with = "Option::deserialize")]
44    pub published_at: Option<String>,
45    #[serde(rename = "reactions", skip_serializing_if = "Option::is_none")]
46    pub reactions: Option<Box<models::Reactions>>,
47    /// The name of the tag.
48    #[serde(rename = "tag_name")]
49    pub tag_name: String,
50    #[serde(rename = "tarball_url", deserialize_with = "Option::deserialize")]
51    pub tarball_url: Option<String>,
52    /// Specifies the commitish value that determines where the Git tag is created from.
53    #[serde(rename = "target_commitish")]
54    pub target_commitish: String,
55    #[serde(rename = "upload_url")]
56    pub upload_url: String,
57    #[serde(rename = "url")]
58    pub url: String,
59    #[serde(rename = "zipball_url", deserialize_with = "Option::deserialize")]
60    pub zipball_url: Option<String>,
61}
62
63impl WebhooksRelease {
64    /// The [release](https://docs.github.com/rest/releases/releases/#get-a-release) object.
65    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 {
66        WebhooksRelease {
67            assets,
68            assets_url,
69            author: author.map(Box::new),
70            body,
71            created_at,
72            discussion_url: None,
73            draft,
74            html_url,
75            id,
76            name,
77            node_id,
78            prerelease,
79            published_at,
80            reactions: None,
81            tag_name,
82            tarball_url,
83            target_commitish,
84            upload_url,
85            url,
86            zipball_url,
87        }
88    }
89}
90