Add issue label and milestone filters
This commit is contained in:
@@ -603,6 +603,8 @@ public protocol GotchaCoreProtocol: AnyObject, Sendable {
|
||||
|
||||
func issue(owner: String, repository: String, number: Int64) async throws -> IssuePage
|
||||
|
||||
func issueFilters(owner: String, repository: String) async throws -> IssueFilterOptions
|
||||
|
||||
func issues(owner: String, repository: String) async throws -> [IssueRow]
|
||||
|
||||
func milestone(owner: String, repository: String, id: Int64) async throws -> MilestonePage
|
||||
@@ -627,6 +629,8 @@ public protocol GotchaCoreProtocol: AnyObject, Sendable {
|
||||
|
||||
func setAppearance(index: UInt32) throws
|
||||
|
||||
func setIssueFilters(owner: String, repository: String, milestone: String, labels: [String]) throws
|
||||
|
||||
func setIssueStatus(status: String) throws
|
||||
|
||||
func setPullStatus(status: String) throws
|
||||
@@ -813,6 +817,22 @@ open func issue(owner: String, repository: String, number: Int64)async throws -
|
||||
)
|
||||
}
|
||||
|
||||
open func issueFilters(owner: String, repository: String)async throws -> IssueFilterOptions {
|
||||
return
|
||||
try await uniffiRustCallAsync(
|
||||
rustFutureFunc: {
|
||||
uniffi_gotcha_core_fn_method_gotchacore_issue_filters(
|
||||
self.uniffiCloneHandle(), FfiConverterString.lower(owner), FfiConverterString.lower(repository)
|
||||
)
|
||||
},
|
||||
pollFunc: ffi_gotcha_core_rust_future_poll_rust_buffer,
|
||||
completeFunc: ffi_gotcha_core_rust_future_complete_rust_buffer,
|
||||
freeFunc: ffi_gotcha_core_rust_future_free_rust_buffer,
|
||||
liftFunc: FfiConverterTypeIssueFilterOptions_lift,
|
||||
errorHandler: FfiConverterTypeGotchaError_lift
|
||||
)
|
||||
}
|
||||
|
||||
open func issues(owner: String, repository: String)async throws -> [IssueRow] {
|
||||
return
|
||||
try await uniffiRustCallAsync(
|
||||
@@ -984,6 +1004,18 @@ open func setAppearance(index: UInt32)throws {try rustCallWithError(FfiConvert
|
||||
}
|
||||
}
|
||||
|
||||
open func setIssueFilters(owner: String, repository: String, milestone: String, labels: [String])throws {try rustCallWithError(FfiConverterTypeGotchaError_lift) {
|
||||
uniffiCallStatus in
|
||||
uniffi_gotcha_core_fn_method_gotchacore_set_issue_filters(
|
||||
self.uniffiCloneHandle(),
|
||||
FfiConverterString.lower(owner),
|
||||
FfiConverterString.lower(repository),
|
||||
FfiConverterString.lower(milestone),
|
||||
FfiConverterSequenceString.lower(labels), uniffiCallStatus
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
open func setIssueStatus(status: String)throws {try rustCallWithError(FfiConverterTypeGotchaError_lift) {
|
||||
uniffiCallStatus in
|
||||
uniffi_gotcha_core_fn_method_gotchacore_set_issue_status(
|
||||
@@ -1657,6 +1689,63 @@ public func FfiConverterTypeHomePage_lower(_ value: HomePage) -> RustBuffer {
|
||||
}
|
||||
|
||||
|
||||
public struct IssueFilterOptions: Equatable, Hashable {
|
||||
public var milestones: [String]
|
||||
public var labels: [String]
|
||||
public var selectedMilestone: String
|
||||
public var selectedLabels: [String]
|
||||
|
||||
// Default memberwise initializers are never public by default, so we
|
||||
// declare one manually.
|
||||
public init(milestones: [String], labels: [String], selectedMilestone: String, selectedLabels: [String]) {
|
||||
self.milestones = milestones
|
||||
self.labels = labels
|
||||
self.selectedMilestone = selectedMilestone
|
||||
self.selectedLabels = selectedLabels
|
||||
}
|
||||
}
|
||||
|
||||
#if compiler(>=6)
|
||||
extension IssueFilterOptions: Sendable {}
|
||||
#endif
|
||||
|
||||
#if swift(>=5.8)
|
||||
@_documentation(visibility: private)
|
||||
#endif
|
||||
public struct FfiConverterTypeIssueFilterOptions: FfiConverterRustBuffer {
|
||||
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> IssueFilterOptions {
|
||||
return
|
||||
try IssueFilterOptions(
|
||||
milestones: FfiConverterSequenceString.read(from: &buf),
|
||||
labels: FfiConverterSequenceString.read(from: &buf),
|
||||
selectedMilestone: FfiConverterString.read(from: &buf),
|
||||
selectedLabels: FfiConverterSequenceString.read(from: &buf)
|
||||
)
|
||||
}
|
||||
|
||||
public static func write(_ value: IssueFilterOptions, into buf: inout [UInt8]) {
|
||||
FfiConverterSequenceString.write(value.milestones, into: &buf)
|
||||
FfiConverterSequenceString.write(value.labels, into: &buf)
|
||||
FfiConverterString.write(value.selectedMilestone, into: &buf)
|
||||
FfiConverterSequenceString.write(value.selectedLabels, into: &buf)
|
||||
}
|
||||
}
|
||||
|
||||
#if swift(>=5.8)
|
||||
@_documentation(visibility: private)
|
||||
#endif
|
||||
public func FfiConverterTypeIssueFilterOptions_lift(_ buf: RustBuffer) throws -> IssueFilterOptions {
|
||||
return try FfiConverterTypeIssueFilterOptions.lift(buf)
|
||||
}
|
||||
|
||||
#if swift(>=5.8)
|
||||
@_documentation(visibility: private)
|
||||
#endif
|
||||
public func FfiConverterTypeIssueFilterOptions_lower(_ value: IssueFilterOptions) -> RustBuffer {
|
||||
return FfiConverterTypeIssueFilterOptions.lower(value)
|
||||
}
|
||||
|
||||
|
||||
public struct IssuePage: Equatable, Hashable {
|
||||
public var title: String
|
||||
public var state: String
|
||||
@@ -2943,6 +3032,9 @@ private let initializationResult: InitializationResult = {
|
||||
if (uniffi_gotcha_core_checksum_method_gotchacore_issue() != 56735) {
|
||||
return InitializationResult.apiChecksumMismatch
|
||||
}
|
||||
if (uniffi_gotcha_core_checksum_method_gotchacore_issue_filters() != 24054) {
|
||||
return InitializationResult.apiChecksumMismatch
|
||||
}
|
||||
if (uniffi_gotcha_core_checksum_method_gotchacore_issues() != 1316) {
|
||||
return InitializationResult.apiChecksumMismatch
|
||||
}
|
||||
@@ -2979,6 +3071,9 @@ private let initializationResult: InitializationResult = {
|
||||
if (uniffi_gotcha_core_checksum_method_gotchacore_set_appearance() != 61293) {
|
||||
return InitializationResult.apiChecksumMismatch
|
||||
}
|
||||
if (uniffi_gotcha_core_checksum_method_gotchacore_set_issue_filters() != 45204) {
|
||||
return InitializationResult.apiChecksumMismatch
|
||||
}
|
||||
if (uniffi_gotcha_core_checksum_method_gotchacore_set_issue_status() != 44445) {
|
||||
return InitializationResult.apiChecksumMismatch
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user