Client
public class Client
Client is the root of all requests. It contains two built-in types of making requests
- Reactive
Singleevents - Completion callbacks
A request may have a few different parameters
- Page and Per Page
- standard pagination, optional
- Filter and Range
- A ParameterObject with optional fields for filtering or applying ranges
- Sort
- A SortObject that contains keys to sort by (ascending or decending)
Certain requests may also include an id parameter. Those will return only a single element.
All other requests return an array of elements
-
Public initializer
Declaration
Swift
public init(_ token: String)Parameters
tokenThe access token to use. Will be passed as an HTTP header
-
Get a single champion by ID
See also
PandaScore DocumentationDeclaration
Swift
func getChampion(by id: Int, completion: @escaping APIResponse<Champion>)Parameters
idThe ID of the champion
completionCallback that returns a champion
-
Get a single champion by ID
See also
PandaScore DocumentationDeclaration
Swift
func getChampion(by id: Int) -> Single<Champion>Parameters
idThe ID of the champion
Return Value
A single emmited Champion event
-
List all champions for the latest version
See also
PandaScore DocumentationDeclaration
Swift
func getChampions(ids: [Int]? = nil, page: Int? = nil, per_page: Int? = nil, completion: @escaping APIResponse<[Champion]>)Parameters
idsA list of champion IDs to filter for
pageThe pagination page to return
per_pageThe number of items per page
completionCallback with list of champions matching any filters that are applied
-
List all champions for the latest version
See also
PandaScore DocumentationDeclaration
Swift
func getChampions(ids: [Int]? = nil, page: Int? = nil, per_page: Int? = nil) -> Single<[Champion]>Parameters
idsA list of champion IDs to filter for
pageThe pagination page to return
per_pageThe number of items per page
Return Value
A Single event emitting a list of champions matching any filters that are applied
-
List all games for a given match
See also
PandaScore DocumentationDeclaration
Swift
func getGames(forMatch id: Int, page: Int? = nil, per_page: Int? = nil, range: GamesForMatchParameterObject? = nil, filter: GamesForMatchParameterObject? = nil, sort: GamesForMatchSortObject? = nil, completion: @escaping APIResponse<[Game]>)Parameters
matchThe match to return games for
pageThe pagination page to return
per_pageThe number of items per page
rangeA range object. See
GamesForMatchParameterObjectfilterA filter object. See
GamesForMatchParameterObjectsortA sort object. See
GamesForMatchSortObjectcompletionCallback with list of champions matching any filters that are applied
-
List all games for a given match
See also
PandaScore DocumentationDeclaration
Swift
func getGames(forMatch id: Int, page: Int? = nil, per_page: Int? = nil, range: GamesForMatchParameterObject? = nil, filter: GamesForMatchParameterObject? = nil, sort: GamesForMatchSortObject? = nil) -> Single<[Game]>Parameters
matchThe match to return games for
pageThe pagination page to return
per_pageThe number of items per page
rangeA range object. See
GamesForMatchParameterObjectfilterA filter object. See
GamesForMatchParameterObjectsortA sort object. See
GamesForMatchSortObjectReturn Value
Emits a single event containing a list of champions matching any filters that are applied
-
Get a single game by ID
See also
PandaScore DocumentationDeclaration
Swift
func getGame(for id: Int, completion: @escaping APIResponse<Game>)Parameters
idThe ID of the game
completionA single APIResponse callback with a single game
-
Get a single game by ID
See also
PandaScore DocumentationDeclaration
Swift
func getGame(for id: Int) -> Single<Game>Parameters
idThe ID of the game
Return Value
Emits a single event containing a Game object
-
Get play-by-play events for a game
See also
PandaScore DocumentationDeclaration
Swift
func getPlayByPlayEvents(for game: Int, page: Int? = nil, per_page: Int? = nil, completion: @escaping APIResponse<[GameEvent]>)Parameters
idThe game to fetch events for
pageThe pagination page to return
per_pageThe number of items per page
completionAPIResponse containing play-by-play events
-
Get play-by-play events for a game
See also
PandaScore DocumentationDeclaration
Swift
func getPlayByPlayEvents(for game: Int, page: Int? = nil, per_page: Int? = nil) -> Single<[GameEvent]>Parameters
idThe game to fetch events for
pageThe pagination page to return
per_pageThe number of items per page
Return Value
Emits a single event containing a list of play-by-play events
-
Get play-by-play frames for a game
See also
PandaScore DocumentationDeclaration
Swift
func getPlayByPlayFrames(for game: Int, page: Int? = nil, per_page: Int? = nil, completion: @escaping APIResponse<[GameFrame]>)Parameters
idThe game to fetch events for
pageThe pagination page to return
per_pageThe number of items per page
completionAPIResponse containing play-by-play frames
-
Get play-by-play frames for a game
See also
PandaScore DocumentationDeclaration
Swift
func getPlayByPlayFrames(for game: Int, page: Int? = nil, per_page: Int? = nil) -> Single<[GameFrame]>Parameters
idThe game to fetch events for
pageThe pagination page to return
per_pageThe number of items per page
Return Value
Emits a single event containing a list of play-by-play frames
-
Undocumented
Declaration
Swift
func getItem(by id: Int, completion: @escaping APIResponse<Item>) -
Undocumented
Declaration
Swift
func getItem(by id: Int) -> Single<Item>
-
Undocumented
Declaration
Swift
func getItems(page: Int? = nil, per_page: Int? = nil, range: ItemsParameterObject? = nil, filter: ItemsParameterObject? = nil, sort: ItemsSortObject? = nil, completion: @escaping APIResponse<[Item]>) -
Undocumented
Declaration
Swift
func getItems(page: Int? = nil, per_page: Int? = nil, range: ItemsParameterObject? = nil, filter: ItemsParameterObject? = nil, sort: ItemsSortObject? = nil) -> Single<[Item]>
-
Undocumented
Declaration
Swift
func getLeagues(page: Int? = nil, per_page: Int? = nil, range: GetLeaguesParameterObject? = nil, filter: GetLeaguesParameterObject? = nil, sort: GetLeaguesSortObject? = nil, completion: @escaping APIResponse<[League]>) -
Undocumented
Declaration
Swift
func getLeagues(page: Int? = nil, per_page: Int? = nil, range: GetLeaguesParameterObject? = nil, filter: GetLeaguesParameterObject? = nil, sort: GetLeaguesSortObject? = nil) -> Single<[League]>
-
Undocumented
Declaration
Swift
func getMatches(timing: Timing = .all, page: Int? = nil, per_page: Int? = nil, range: GetMatchesParameterObject? = nil, filter: GetMatchesParameterObject? = nil, sort: GetMatchesSortObject? = nil, completion: @escaping APIResponse<[Match]>) -
Undocumented
Declaration
Swift
func getMatches(timing: Timing = .all, page: Int? = nil, per_page: Int? = nil, range: GetMatchesParameterObject? = nil, filter: GetMatchesParameterObject? = nil, sort: GetMatchesSortObject? = nil) -> Single<[Match]>
-
Undocumented
Declaration
Swift
func getPlayers(for type: GroupingType = .all, with id: Int? = nil, page: Int? = nil, per_page: Int? = nil, range: PlayerParameterObject? = nil, filter: PlayerParameterObject? = nil, sort: PlayerSortObject? = nil, completion: @escaping APIResponse<[Player]>) -
Undocumented
Declaration
Swift
func getPlayers(for type: GroupingType = .all, with id: Int? = nil, page: Int? = nil, per_page: Int? = nil, range: PlayerParameterObject? = nil, filter: PlayerParameterObject? = nil, sort: PlayerSortObject? = nil) -> Single<[Player]>
-
Undocumented
Declaration
Swift
func getSeries(timing: Timing = .all, page: Int? = nil, per_page: Int? = nil, range: SeriesParameterObject? = nil, filter: SeriesParameterObject? = nil, sort: SeriesSortObject? = nil, completion: @escaping APIResponse<[Serie]>) -
Undocumented
Declaration
Swift
func getSeries(timing: Timing = .all, page: Int? = nil, per_page: Int? = nil, range: SeriesParameterObject? = nil, filter: SeriesParameterObject? = nil, sort: SeriesSortObject? = nil) -> Single<[Serie]>
-
Undocumented
Declaration
Swift
func getPlayerStats(for grouping: GroupingType = .all, id: Int, completion: @escaping APIResponse<StatsPlayer>) -
Undocumented
Declaration
Swift
func getPlayerStats(for grouping: GroupingType = .all, id: Int) -> Single<StatsPlayer>
-
Undocumented
Declaration
Swift
func getTeamStats(for grouping: GroupingType = .all, id: Int, completion: @escaping APIResponse<StatsTeam>) -
Undocumented
Declaration
Swift
func getTeamStats(for grouping: GroupingType = .all, id: Int) -> Single<StatsTeam>
-
Undocumented
Declaration
Swift
func getTeams(for type: GroupingType = .all, id: Int? = nil, completion: @escaping APIResponse<[Team]>) -
Undocumented
Declaration
Swift
func getTeams(for type: GroupingType = .all, id: Int? = nil) -> Single<[Team]>
-
Undocumented
Declaration
Swift
func getTournaments(for type: Timing = .all, page: Int? = nil, per_page: Int? = nil, range: TournamentsParameterObject? = nil, filter: TournamentsParameterObject? = nil, sort: TournamentsSortObject? = nil, completion: @escaping APIResponse<[Tournament]>) -
Undocumented
Declaration
Swift
func getTournaments(for type: Timing = .all, page: Int? = nil, per_page: Int? = nil, range: TournamentsParameterObject? = nil, filter: TournamentsParameterObject? = nil, sort: TournamentsSortObject? = nil) -> Single<[Tournament]>
Client Class Reference