Allow milestones to be closed and reopened

This commit is contained in:
Georg Bauer
2026-08-01 14:58:49 +02:00
parent 3a69b70395
commit 047f0ab0dc
10 changed files with 64 additions and 23 deletions

View File

@@ -657,7 +657,7 @@ public protocol GotchaCoreProtocol: AnyObject, Sendable {
func saveIssueComment(owner: String, repository: String, number: Int64, commentId: Int64?, body: String) async throws
func saveMilestone(owner: String, repository: String, id: Int64?, title: String, description: String, dueDate: Int64?) async throws -> Int64
func saveMilestone(owner: String, repository: String, id: Int64?, draft: MilestoneEditorPage) async throws -> Int64
func selectServer(index: UInt32) throws
@@ -1133,12 +1133,12 @@ open func saveIssueComment(owner: String, repository: String, number: Int64, com
)
}
open func saveMilestone(owner: String, repository: String, id: Int64?, title: String, description: String, dueDate: Int64?)async throws -> Int64 {
open func saveMilestone(owner: String, repository: String, id: Int64?, draft: MilestoneEditorPage)async throws -> Int64 {
return
try await uniffiRustCallAsync(
rustFutureFunc: {
uniffi_gotcha_core_fn_method_gotchacore_save_milestone(
self.uniffiCloneHandle(),FfiConverterString.lower(owner),FfiConverterString.lower(repository),FfiConverterOptionInt64.lower(id),FfiConverterString.lower(title),FfiConverterString.lower(description),FfiConverterOptionInt64.lower(dueDate)
self.uniffiCloneHandle(),FfiConverterString.lower(owner),FfiConverterString.lower(repository),FfiConverterOptionInt64.lower(id),FfiConverterTypeMilestoneEditorPage_lower(draft)
)
},
pollFunc: ffi_gotcha_core_rust_future_poll_i64,
@@ -2571,13 +2571,15 @@ public struct MilestoneEditorPage: Equatable, Hashable {
public var title: String
public var description: String
public var dueDate: Int64?
public var closed: Bool
// Default memberwise initializers are never public by default, so we
// declare one manually.
public init(title: String, description: String, dueDate: Int64?) {
public init(title: String, description: String, dueDate: Int64?, closed: Bool) {
self.title = title
self.description = description
self.dueDate = dueDate
self.closed = closed
}
@@ -2598,7 +2600,8 @@ public struct FfiConverterTypeMilestoneEditorPage: FfiConverterRustBuffer {
try MilestoneEditorPage(
title: FfiConverterString.read(from: &buf),
description: FfiConverterString.read(from: &buf),
dueDate: FfiConverterOptionInt64.read(from: &buf)
dueDate: FfiConverterOptionInt64.read(from: &buf),
closed: FfiConverterBool.read(from: &buf)
)
}
@@ -2606,6 +2609,7 @@ public struct FfiConverterTypeMilestoneEditorPage: FfiConverterRustBuffer {
FfiConverterString.write(value.title, into: &buf)
FfiConverterString.write(value.description, into: &buf)
FfiConverterOptionInt64.write(value.dueDate, into: &buf)
FfiConverterBool.write(value.closed, into: &buf)
}
}
@@ -4354,7 +4358,7 @@ private let initializationResult: InitializationResult = {
if (uniffi_gotcha_core_checksum_method_gotchacore_save_issue_comment() != 58596) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_gotcha_core_checksum_method_gotchacore_save_milestone() != 33075) {
if (uniffi_gotcha_core_checksum_method_gotchacore_save_milestone() != 9828) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_gotcha_core_checksum_method_gotchacore_select_server() != 22721) {