Add issue comment editing
This commit is contained in:
@@ -649,6 +649,8 @@ public protocol GotchaCoreProtocol: AnyObject, Sendable {
|
||||
|
||||
func saveIssue(owner: String, repository: String, number: Int64?, title: String, body: String, labelIds: [Int64], milestoneId: Int64?, dueDate: Int64?) async throws -> Int64
|
||||
|
||||
func saveIssueComment(owner: String, repository: String, number: Int64, commentId: Int64?, body: String) async throws
|
||||
|
||||
func selectServer(index: UInt32) throws
|
||||
|
||||
func servers() -> [ServerRow]
|
||||
@@ -1073,6 +1075,22 @@ open func saveIssue(owner: String, repository: String, number: Int64?, title: St
|
||||
)
|
||||
}
|
||||
|
||||
open func saveIssueComment(owner: String, repository: String, number: Int64, commentId: Int64?, body: String)async throws {
|
||||
return
|
||||
try await uniffiRustCallAsync(
|
||||
rustFutureFunc: {
|
||||
uniffi_gotcha_core_fn_method_gotchacore_save_issue_comment(
|
||||
self.uniffiCloneHandle(),FfiConverterString.lower(owner),FfiConverterString.lower(repository),FfiConverterInt64.lower(number),FfiConverterOptionInt64.lower(commentId),FfiConverterString.lower(body)
|
||||
)
|
||||
},
|
||||
pollFunc: ffi_gotcha_core_rust_future_poll_void,
|
||||
completeFunc: ffi_gotcha_core_rust_future_complete_void,
|
||||
freeFunc: ffi_gotcha_core_rust_future_free_void,
|
||||
liftFunc: { $0 },
|
||||
errorHandler: FfiConverterTypeGotchaError_lift
|
||||
)
|
||||
}
|
||||
|
||||
open func selectServer(index: UInt32)throws {try rustCallWithError(FfiConverterTypeGotchaError_lift) {
|
||||
uniffiCallStatus in
|
||||
uniffi_gotcha_core_fn_method_gotchacore_select_server(
|
||||
@@ -1299,16 +1317,20 @@ public func FfiConverterTypeActivityRow_lower(_ value: ActivityRow) -> RustBuffe
|
||||
|
||||
|
||||
public struct CommentRow: Equatable, Hashable {
|
||||
public var id: Int64
|
||||
public var author: String
|
||||
public var body: String
|
||||
public var meta: String
|
||||
public var canEdit: Bool
|
||||
|
||||
// Default memberwise initializers are never public by default, so we
|
||||
// declare one manually.
|
||||
public init(author: String, body: String, meta: String) {
|
||||
public init(id: Int64, author: String, body: String, meta: String, canEdit: Bool) {
|
||||
self.id = id
|
||||
self.author = author
|
||||
self.body = body
|
||||
self.meta = meta
|
||||
self.canEdit = canEdit
|
||||
}
|
||||
|
||||
|
||||
@@ -1327,16 +1349,20 @@ public struct FfiConverterTypeCommentRow: FfiConverterRustBuffer {
|
||||
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> CommentRow {
|
||||
return
|
||||
try CommentRow(
|
||||
id: FfiConverterInt64.read(from: &buf),
|
||||
author: FfiConverterString.read(from: &buf),
|
||||
body: FfiConverterString.read(from: &buf),
|
||||
meta: FfiConverterString.read(from: &buf)
|
||||
meta: FfiConverterString.read(from: &buf),
|
||||
canEdit: FfiConverterBool.read(from: &buf)
|
||||
)
|
||||
}
|
||||
|
||||
public static func write(_ value: CommentRow, into buf: inout [UInt8]) {
|
||||
FfiConverterInt64.write(value.id, into: &buf)
|
||||
FfiConverterString.write(value.author, into: &buf)
|
||||
FfiConverterString.write(value.body, into: &buf)
|
||||
FfiConverterString.write(value.meta, into: &buf)
|
||||
FfiConverterBool.write(value.canEdit, into: &buf)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3882,6 +3908,9 @@ private let initializationResult: InitializationResult = {
|
||||
if (uniffi_gotcha_core_checksum_method_gotchacore_save_issue() != 55053) {
|
||||
return InitializationResult.apiChecksumMismatch
|
||||
}
|
||||
if (uniffi_gotcha_core_checksum_method_gotchacore_save_issue_comment() != 58596) {
|
||||
return InitializationResult.apiChecksumMismatch
|
||||
}
|
||||
if (uniffi_gotcha_core_checksum_method_gotchacore_select_server() != 22721) {
|
||||
return InitializationResult.apiChecksumMismatch
|
||||
}
|
||||
|
||||
@@ -374,6 +374,11 @@ uint64_t uniffi_gotcha_core_fn_method_gotchacore_repository_file(uint64_t ptr, R
|
||||
uint64_t uniffi_gotcha_core_fn_method_gotchacore_save_issue(uint64_t ptr, RustBuffer owner, RustBuffer repository, RustBuffer number, RustBuffer title, RustBuffer body, RustBuffer label_ids, RustBuffer milestone_id, RustBuffer due_date
|
||||
);
|
||||
#endif
|
||||
#ifndef UNIFFI_FFIDEF_UNIFFI_GOTCHA_CORE_FN_METHOD_GOTCHACORE_SAVE_ISSUE_COMMENT
|
||||
#define UNIFFI_FFIDEF_UNIFFI_GOTCHA_CORE_FN_METHOD_GOTCHACORE_SAVE_ISSUE_COMMENT
|
||||
uint64_t uniffi_gotcha_core_fn_method_gotchacore_save_issue_comment(uint64_t ptr, RustBuffer owner, RustBuffer repository, int64_t number, RustBuffer comment_id, RustBuffer body
|
||||
);
|
||||
#endif
|
||||
#ifndef UNIFFI_FFIDEF_UNIFFI_GOTCHA_CORE_FN_METHOD_GOTCHACORE_SELECT_SERVER
|
||||
#define UNIFFI_FFIDEF_UNIFFI_GOTCHA_CORE_FN_METHOD_GOTCHACORE_SELECT_SERVER
|
||||
void uniffi_gotcha_core_fn_method_gotchacore_select_server(uint64_t ptr, uint32_t index, RustCallStatus *_Nonnull out_status
|
||||
@@ -820,6 +825,12 @@ uint16_t uniffi_gotcha_core_checksum_method_gotchacore_repository_file(void
|
||||
#define UNIFFI_FFIDEF_UNIFFI_GOTCHA_CORE_CHECKSUM_METHOD_GOTCHACORE_SAVE_ISSUE
|
||||
uint16_t uniffi_gotcha_core_checksum_method_gotchacore_save_issue(void
|
||||
|
||||
);
|
||||
#endif
|
||||
#ifndef UNIFFI_FFIDEF_UNIFFI_GOTCHA_CORE_CHECKSUM_METHOD_GOTCHACORE_SAVE_ISSUE_COMMENT
|
||||
#define UNIFFI_FFIDEF_UNIFFI_GOTCHA_CORE_CHECKSUM_METHOD_GOTCHACORE_SAVE_ISSUE_COMMENT
|
||||
uint16_t uniffi_gotcha_core_checksum_method_gotchacore_save_issue_comment(void
|
||||
|
||||
);
|
||||
#endif
|
||||
#ifndef UNIFFI_FFIDEF_UNIFFI_GOTCHA_CORE_CHECKSUM_METHOD_GOTCHACORE_SELECT_SERVER
|
||||
|
||||
Reference in New Issue
Block a user