openapi_github/models/
repos_update_release_request.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#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct ReposUpdateReleaseRequest {
16    /// The name of the tag.
17    #[serde(rename = "tag_name", skip_serializing_if = "Option::is_none")]
18    pub tag_name: Option<String>,
19    /// Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch.
20    #[serde(rename = "target_commitish", skip_serializing_if = "Option::is_none")]
21    pub target_commitish: Option<String>,
22    /// The name of the release.
23    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
24    pub name: Option<String>,
25    /// Text describing the contents of the tag.
26    #[serde(rename = "body", skip_serializing_if = "Option::is_none")]
27    pub body: Option<String>,
28    /// `true` makes the release a draft, and `false` publishes the release.
29    #[serde(rename = "draft", skip_serializing_if = "Option::is_none")]
30    pub draft: Option<bool>,
31    /// `true` to identify the release as a prerelease, `false` to identify the release as a full release.
32    #[serde(rename = "prerelease", skip_serializing_if = "Option::is_none")]
33    pub prerelease: Option<bool>,
34    /// Specifies whether this release should be set as the latest release for the repository. Drafts and prereleases cannot be set as latest. Defaults to `true` for newly published releases. `legacy` specifies that the latest release should be determined based on the release creation date and higher semantic version.
35    #[serde(rename = "make_latest", skip_serializing_if = "Option::is_none")]
36    pub make_latest: Option<MakeLatest>,
37    /// If specified, a discussion of the specified category is created and linked to the release. The value must be a category that already exists in the repository. If there is already a discussion linked to the release, this parameter is ignored. For more information, see \"[Managing categories for discussions in your repository](https://docs.github.com/discussions/managing-discussions-for-your-community/managing-categories-for-discussions-in-your-repository).\"
38    #[serde(rename = "discussion_category_name", skip_serializing_if = "Option::is_none")]
39    pub discussion_category_name: Option<String>,
40}
41
42impl ReposUpdateReleaseRequest {
43    pub fn new() -> ReposUpdateReleaseRequest {
44        ReposUpdateReleaseRequest {
45            tag_name: None,
46            target_commitish: None,
47            name: None,
48            body: None,
49            draft: None,
50            prerelease: None,
51            make_latest: None,
52            discussion_category_name: None,
53        }
54    }
55}
56/// Specifies whether this release should be set as the latest release for the repository. Drafts and prereleases cannot be set as latest. Defaults to `true` for newly published releases. `legacy` specifies that the latest release should be determined based on the release creation date and higher semantic version.
57#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
58pub enum MakeLatest {
59    #[serde(rename = "true")]
60    True,
61    #[serde(rename = "false")]
62    False,
63    #[serde(rename = "legacy")]
64    Legacy,
65}
66
67impl Default for MakeLatest {
68    fn default() -> MakeLatest {
69        Self::True
70    }
71}
72