Match Quiz Game Operations

The Match Quiz Game namespace provides functionality for managing match quiz prediction games.

Game Configuration

suspend fun getConfig(): MatchQuizConfig?

Retrieves Match Quiz specific configuration settings.

Prediction Management

Submit Prediction

suspend fun play(request: MatchQuizRequestModel): PredictionResponseModel?

Creates new Match Quiz prediction:

  • Takes game instance ID and fixtures
  • Returns created prediction data

Delete Prediction

suspend fun delete(predictionGameId: String): Boolean?

Removes predictions for a specific game.

Game Queries

Game Listings

// Get all games
suspend fun getGames(
    filters: GameFilters? = null,
    disableCache: Boolean? = null
): CursorResponse<List<GameListModel>>?

// Get single game
suspend fun getGameById(
    gameId: String,
    disableCache: Boolean? = null
): GameByIdModel?

User Participation

// Get current user's games
suspend fun getMyGameEditions(
    filters: MainCursorFilters? = null,
    disableCache: Boolean? = null
): CursorResponse<List<GameMatchQuizListModel>>?

// Get specific user's games
suspend fun getUserGameEditions(
    userId: String,
    filters: MainCursorFilters?,
    disableCache: Boolean?
): CursorResponse<List<GameMatchQuizListModel>>?

Results & Predictions

Results

// Get game results
suspend fun getGameResults(
    gameId: String,
    filters: MainCursorFilters? = null,
    disableCache: Boolean? = null
): CursorResponse<List<GameResultsModel>>?

// Get current game results
suspend fun getCurrentGameResults(
    disableCache: Boolean?
): GameResultsModel?

// Get market results
suspend fun getMarketsResultsForGame(
    gameId: String,
    disableCache: Boolean? = null
): GameMarketsResults

Predictions

// Get game predictions
suspend fun getGamePredictions(
    gameId: String,
    filters: PredictionsFilters? = null,
    disableCache: Boolean? = null
): CursorResponse<List<PredictionResponseModel>>?

// Get user predictions
suspend fun getMyGamePrediction(
    gameId: String
): List<PredictionResponseModel>?

// Get other user's predictions
suspend fun getUserGamePrediction(
    userId: String,
    gameId: String,
    disableCache: Boolean? = null
): List<PredictionResponseModel>?

Game Helpers

// Get helpers instance
suspend fun helpers(): IGameHelpers

// Find current game
suspend fun findCurrentGame(games: List<GameListModel>): GameListModel?

// Find last game
suspend fun findLastGame(games: List<GameListModel>): GameListModel?

// Find next game
suspend fun findNextGame(games: List<GameListModel>): GameListModel?

Contest Results

suspend fun getGameWinners(
    gameId: String,
    disableCache: Boolean?
): ContestWinners?

Example Usage

// Initialize SDK
val sdk = FansUnitedSDK.init(config)

// Submit prediction
val prediction = sdk.matchQuiz().play(
    MatchQuizRequestModel(
        gameId = "game:123",
        fixtures = listOf(/* fixture predictions */)
    )
)

// Get games with helper
val games = sdk.matchQuiz().getGames()
val currentGame = sdk.matchQuiz().helpers().findCurrentGame(games.items)

// Get my games
val myGames = sdk.matchQuiz().getMyGameEditions(
    filters = MainCursorFilters(limit = 10)
)

Note: All operations are suspending functions and must be called from a coroutine scope.