openapi_github/models/
repos_create_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 ReposCreateReleaseRequest {
16    /// The name of the tag.
17    #[serde(rename = "tag_name")]
18    pub tag_name: 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` to create a draft (unpublished) release, `false` to create a published one.
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    /// 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. 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).\"
35    #[serde(rename = "discussion_category_name", skip_serializing_if = "Option::is_none")]
36    pub discussion_category_name: Option<String>,
37    /// Whether to automatically generate the name and body for this release. If `name` is specified, the specified name will be used; otherwise, a name will be automatically generated. If `body` is specified, the body will be pre-pended to the automatically generated notes.
38    #[serde(rename = "generate_release_notes", skip_serializing_if = "Option::is_none")]
39    pub generate_release_notes: Option<bool>,
40    /// 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.
41    #[serde(rename = "make_latest", skip_serializing_if = "Option::is_none")]
42    pub make_latest: Option<MakeLatest>,
43}
44
45impl ReposCreateReleaseRequest {
46    pub fn new(tag_name: String) -> ReposCreateReleaseRequest {
47        ReposCreateReleaseRequest {
48            tag_name,
49            target_commitish: None,
50            name: None,
51            body: None,
52            draft: None,
53            prerelease: None,
54            discussion_category_name: None,
55            generate_release_notes: None,
56            make_latest: None,
57        }
58    }
59}
60/// 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.
61#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
62pub enum MakeLatest {
63    #[serde(rename = "true")]
64    True,
65    #[serde(rename = "false")]
66    False,
67    #[serde(rename = "legacy")]
68    Legacy,
69}
70
71impl Default for MakeLatest {
72    fn default() -> MakeLatest {
73        Self::True
74    }
75}
76