1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/*
* 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};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ReposUpdateReleaseRequest {
/// The name of the tag.
#[serde(rename = "tag_name", skip_serializing_if = "Option::is_none")]
pub tag_name: Option<String>,
/// 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.
#[serde(rename = "target_commitish", skip_serializing_if = "Option::is_none")]
pub target_commitish: Option<String>,
/// The name of the release.
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
/// Text describing the contents of the tag.
#[serde(rename = "body", skip_serializing_if = "Option::is_none")]
pub body: Option<String>,
/// `true` makes the release a draft, and `false` publishes the release.
#[serde(rename = "draft", skip_serializing_if = "Option::is_none")]
pub draft: Option<bool>,
/// `true` to identify the release as a prerelease, `false` to identify the release as a full release.
#[serde(rename = "prerelease", skip_serializing_if = "Option::is_none")]
pub prerelease: Option<bool>,
/// 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.
#[serde(rename = "make_latest", skip_serializing_if = "Option::is_none")]
pub make_latest: Option<MakeLatest>,
/// 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).\"
#[serde(rename = "discussion_category_name", skip_serializing_if = "Option::is_none")]
pub discussion_category_name: Option<String>,
}
impl ReposUpdateReleaseRequest {
pub fn new() -> ReposUpdateReleaseRequest {
ReposUpdateReleaseRequest {
tag_name: None,
target_commitish: None,
name: None,
body: None,
draft: None,
prerelease: None,
make_latest: None,
discussion_category_name: None,
}
}
}
/// 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.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum MakeLatest {
#[serde(rename = "true")]
True,
#[serde(rename = "false")]
False,
#[serde(rename = "legacy")]
Legacy,
}
impl Default for MakeLatest {
fn default() -> MakeLatest {
Self::True
}
}