diff options
author | Ross <rosssullivan101@gmail.com> | 2024-06-11 21:29:10 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-11 14:29:10 +0200 |
commit | cb553931727b1e4e7774ecab0609e45881f7c836 (patch) | |
tree | 717f271b4e957ab7f2e738268de4b545c98a7bf8 | |
parent | 0aef32a7c726502d5e869e4a34a0593407ea500c (diff) |
Added support for make_latest in UpdateReleaseBuilder (#646)
-rw-r--r-- | src/api/repos/releases.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/api/repos/releases.rs b/src/api/repos/releases.rs index 93cd7ff..dcf4db7 100644 --- a/src/api/repos/releases.rs +++ b/src/api/repos/releases.rs @@ -403,6 +403,8 @@ pub struct UpdateReleaseBuilder<'octo, 'repos, 'handler, 'tag_name, 'target_comm draft: Option<bool>, #[serde(skip_serializing_if = "Option::is_none")] prerelease: Option<bool>, + #[serde(skip_serializing_if = "Option::is_none")] + make_latest: Option<MakeLatest>, } impl<'octo, 'repos, 'handler, 'tag_name, 'target_commitish, 'name, 'body> @@ -418,6 +420,7 @@ impl<'octo, 'repos, 'handler, 'tag_name, 'target_commitish, 'name, 'body> body: None, draft: None, prerelease: None, + make_latest: None, } } @@ -463,6 +466,14 @@ impl<'octo, 'repos, 'handler, 'tag_name, 'target_commitish, 'name, 'body> self } + /// Specifies whether this release should be set as the latest release for the repository. + /// Drafts and prereleases cannot be set as latest. + /// [`MakeLatest::Legacy`] specifies that the latest release should be determined based on the release creation date and higher semantic version. + pub fn make_latest(mut self, make_latest: MakeLatest) -> Self { + self.make_latest = Some(make_latest); + self + } + /// Sends the actual request. pub async fn send(self) -> crate::Result<crate::models::repos::Release> { let route = format!( |