/
MatchV5.jl
71 lines (64 loc) · 2.86 KB
/
MatchV5.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
module MatchV5 # LOLTools
using ..LOLTools: AbstractDTO, lol_api_server, http_action, call_api, nothing_in_event
using HTTP
"""
Get a list of match ids by puuid
matches_by_puuid(api_key::String,
region::String,
puuid::String ;
endpoint::HTTP.URI = lol_api_server(region),
action::Function = http_action,
event::Function = nothing_in_event)::Vector{String}
"""
function matches_by_puuid(api_key::String,
region::String,
puuid::String ;
endpoint::HTTP.URI = lol_api_server(region),
action::Function = http_action,
event::Function = nothing_in_event,
query::Union{Nothing,Dict{String,String}} = nothing)::Vector{String}
call_api(Vector{String}, api_key, action, endpoint, "/lol/match/v5/matches/by-puuid/$puuid/ids", event, matches_by_puuid; query=query)
end
struct MatchDto <: AbstractDTO
metadata
info
end
"""
Get a match by match id
match_by_match_id(api_key::String,
region::String,
matchId::String ;
endpoint::HTTP.URI = lol_api_server(region),
action::Function = http_action,
event::Function = nothing_in_event)::MatchDto
"""
function match_by_match_id(api_key::String,
region::String,
matchId::String ;
endpoint::HTTP.URI = lol_api_server(region),
action::Function = http_action,
event::Function = nothing_in_event)::MatchDto
call_api(MatchDto, api_key, action, endpoint, "/lol/match/v5/matches/$matchId", event, match_by_match_id)
end
struct MatchTimelineDto <: AbstractDTO
metadata
info
end
"""
Get a match timeline by match id
match_timeline_by_match_id(api_key::String,
region::String,
matchId::String ;
endpoint::HTTP.URI = lol_api_server(region),
action::Function = http_action,
event::Function = nothing_in_event)::MatchTimelineDto
"""
function match_timeline_by_match_id(api_key::String,
region::String,
matchId::String ;
endpoint::HTTP.URI = lol_api_server(region),
action::Function = http_action,
event::Function = nothing_in_event)::MatchTimelineDto
call_api(MatchTimelineDto, api_key, action, endpoint, "/lol/match/v5/matches/$matchId/timeline", event, match_timeline_by_match_id)
end
end # module LOLTools.MatchV5