Tournament API
getRecommendedTournaments(includeClosed: Bool = false, limit: Int = 50) async -> Result<[TournamentsMatchup], TournamentError>
getRecommendedTournaments(includeClosed: Bool = false, limit: Int = 50) async -> Result<[TournamentsMatchup], TournamentError>Parameters
Returns
Example (Swift)
let result = await lucraClient.api.getRecommendedTournaments(includeClosed: true, limit: 50)
switch result {
case .success(let tournaments):
print("Recommended tournaments: \(tournaments.count)")
case .failure(let error):
print("Failed to load tournaments: \(error)")
}tournamentsMatchup(for matchupID: String) async -> Result<TournamentsMatchup, TournamentError>
tournamentsMatchup(for matchupID: String) async -> Result<TournamentsMatchup, TournamentError>Parameters
Returns
Example
joinTournament(matchupId: String, joinCode: String? = nil) async -> Result<Bool, TournamentError>
joinTournament(matchupId: String, joinCode: String? = nil) async -> Result<Bool, TournamentError>Parameters
Returns
Behavior
Failure Cases
User State Errors
Location Errors
API Errors
Example
submitUserScore(_:tournamentID:metadata:isFinal:) async -> Result<TournamentsMatchup?, TournamentError>
submitUserScore(_:tournamentID:metadata:isFinal:) async -> Result<TournamentsMatchup?, TournamentError>Parameters
Returns
Behavior
Example
Error Model
TournamentError
TournamentErrorUserStateError
UserStateErrorLocationError
LocationErrorLast updated
