football-butler 1.1.0 → 2.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. checksums.yaml +4 -4
  2. data/lib/football/butler/api.rb +10 -16
  3. data/lib/football/butler/api_football/base_api_football.rb +17 -0
  4. data/lib/football/butler/api_football/coachs.rb +46 -0
  5. data/lib/football/butler/api_football/countries.rb +39 -0
  6. data/lib/football/butler/api_football/fixtures.rb +80 -0
  7. data/lib/football/butler/api_football/head_to_head.rb +56 -0
  8. data/lib/football/butler/api_football/injuries.rb +62 -0
  9. data/lib/football/butler/api_football/leagues.rb +101 -0
  10. data/lib/football/butler/api_football/lineups.rb +39 -0
  11. data/lib/football/butler/api_football/odds.rb +55 -0
  12. data/lib/football/butler/api_football/players.rb +47 -0
  13. data/lib/football/butler/api_football/predictions.rb +27 -0
  14. data/lib/football/butler/api_football/sidelineds.rb +37 -0
  15. data/lib/football/butler/api_football/standings.rb +35 -0
  16. data/lib/football/butler/api_football/statistics.rb +22 -0
  17. data/lib/football/butler/api_football/teams.rb +66 -0
  18. data/lib/football/butler/api_football/timezones.rb +21 -0
  19. data/lib/football/butler/api_football/top_scorers.rb +22 -0
  20. data/lib/football/butler/api_football/transfers.rb +36 -0
  21. data/lib/football/butler/api_football/trophies.rb +37 -0
  22. data/lib/football/butler/api_football/venues.rb +66 -0
  23. data/lib/football/butler/apifootball/base_apifootball.rb +17 -0
  24. data/lib/football/butler/apifootball/competitions.rb +30 -0
  25. data/lib/football/butler/apifootball/countries.rb +20 -0
  26. data/lib/football/butler/apifootball/events.rb +61 -0
  27. data/lib/football/butler/apifootball/head_to_head.rb +30 -0
  28. data/lib/football/butler/apifootball/lineups.rb +22 -0
  29. data/lib/football/butler/apifootball/odds.rb +25 -0
  30. data/lib/football/butler/apifootball/players.rb +27 -0
  31. data/lib/football/butler/apifootball/predictions.rb +28 -0
  32. data/lib/football/butler/apifootball/standings.rb +23 -0
  33. data/lib/football/butler/apifootball/statistics.rb +22 -0
  34. data/lib/football/butler/apifootball/teams.rb +29 -0
  35. data/lib/football/butler/apifootball/top_scorers.rb +22 -0
  36. data/lib/football/butler/areas.rb +23 -23
  37. data/lib/football/butler/base.rb +45 -18
  38. data/lib/football/butler/coachs.rb +26 -0
  39. data/lib/football/butler/competitions.rb +53 -44
  40. data/lib/football/butler/configuration.rb +275 -14
  41. data/lib/football/butler/countries.rb +11 -0
  42. data/lib/football/butler/events.rb +11 -0
  43. data/lib/football/butler/fixtures.rb +11 -0
  44. data/lib/football/butler/football_data/areas.rb +40 -0
  45. data/lib/football/butler/football_data/competitions.rb +72 -0
  46. data/lib/football/butler/football_data/head_to_head.rb +27 -0
  47. data/lib/football/butler/football_data/lineups.rb +32 -0
  48. data/lib/football/butler/football_data/matches.rb +110 -0
  49. data/lib/football/butler/football_data/odds.rb +27 -0
  50. data/lib/football/butler/football_data/players.rb +20 -0
  51. data/lib/football/butler/football_data/scorers.rb +23 -0
  52. data/lib/football/butler/football_data/standings.rb +47 -0
  53. data/lib/football/butler/football_data/teams.rb +39 -0
  54. data/lib/football/butler/head_to_head.rb +28 -0
  55. data/lib/football/butler/injuries.rb +31 -0
  56. data/lib/football/butler/leagues.rb +11 -0
  57. data/lib/football/butler/lineups.rb +18 -0
  58. data/lib/football/butler/matches.rb +48 -83
  59. data/lib/football/butler/odds.rb +18 -0
  60. data/lib/football/butler/players.rb +26 -0
  61. data/lib/football/butler/predictions.rb +17 -0
  62. data/lib/football/butler/scorers.rb +22 -0
  63. data/lib/football/butler/sidelineds.rb +20 -0
  64. data/lib/football/butler/standings.rb +16 -29
  65. data/lib/football/butler/statistics.rb +17 -0
  66. data/lib/football/butler/teams.rb +23 -23
  67. data/lib/football/butler/tier.rb +26 -11
  68. data/lib/football/butler/timezones.rb +16 -0
  69. data/lib/football/butler/top_scorers.rb +11 -0
  70. data/lib/football/butler/transfers.rb +21 -0
  71. data/lib/football/butler/trophies.rb +21 -0
  72. data/lib/football/butler/venues.rb +34 -0
  73. data/lib/football/butler/version.rb +8 -2
  74. data/lib/football/butler.rb +19 -0
  75. metadata +69 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 991c183f8fbd4c8d04110b3d4bc59007a12fbf3d579c9b34d01f7744757d75d8
4
- data.tar.gz: 5ecc30f4564d7a0c2e3a403f172ad69c83c229e46376162cdeb8ccb8060712bd
3
+ metadata.gz: 73aaf5b7373f6bc121c70b0595678dfbe68368657c5564e94570ea68821e4299
4
+ data.tar.gz: 3753f50ea821aa9b3f08962926a3b7dc5627e1cf8e2693a85b503bb2395e4265
5
5
  SHA512:
6
- metadata.gz: 28d38f92b44efd7373985204acfbbe85fe69fb30a98fc43f6e0f603c0fb4496202d55ad35156433d1598bfb2fad59a2e9b0c1b1bd4a3e7cbd2e70cdbd0b84e24
7
- data.tar.gz: 896d915e99ea08fe238610c114ccdc3a705c9186c108f2655942f280842bbf14984f0ea9220c6778cc9130044cfc4d6928c5a0b406e277ee07867d363b67f561
6
+ metadata.gz: 87b47413453c999564da314d5483a7c100f36f59ffe7c75c06dba8cbb69b65557632527354f1afec9de85d65ab02bdbb8aeb74b96d4b972812e0daff58bbac06
7
+ data.tar.gz: 4a624803962bc33c4aeb5d4ad13feaaaa19481204951cc16b5f2830c91fdd213ccf6f7442334faa54514868345acad52c2df2118487cca2ea462844ea2a2b352
@@ -30,7 +30,7 @@ module Football
30
30
  end
31
31
 
32
32
  response = process_http_party(path, filters)
33
- Tier.set_from_response_headers(response)
33
+ Configuration.tier_from_response(response)
34
34
 
35
35
  if reached_limit?(response)
36
36
  response = process_retry(path, filters)
@@ -50,7 +50,7 @@ module Football
50
50
  sleep(Tier.get_sleep_seconds) unless Rails.env.test?
51
51
 
52
52
  response = process_http_party(path, filters)
53
- Tier.set_from_response_headers(response)
53
+ Configuration.tier_from_response(response)
54
54
 
55
55
  break unless reached_limit?(response)
56
56
  end
@@ -58,29 +58,23 @@ module Football
58
58
  end
59
59
 
60
60
  def process_http_party(path, filters)
61
- headers = {
62
- "X-Auth-Token": Configuration.api_token
63
- }
64
- url = "#{Configuration.api_endpoint}/#{path}"
65
- query = filters || {}
66
-
61
+ headers = Configuration.http_party_headers
62
+ url = Configuration.http_party_url(path)
63
+ query = filters || {}
67
64
  http_party_get(url, headers, query)
68
65
  end
69
66
 
70
67
  def process_response(response, result)
71
- if response.dig('message')
68
+ if response.parsed_response.is_a?(Hash) && response.dig('message')
72
69
  error_message(response['message'])
73
70
  else
74
- case result
75
- when :default
76
- response
77
- else
78
- response&.keys&.include?(result.to_s) ? response[result.to_s] : nil
79
- end
71
+ Configuration.http_party_response(response, result)
80
72
  end
81
73
  end
82
74
 
83
75
  def http_party_get(url, headers, query)
76
+ Tier.count_request
77
+
84
78
  HTTParty.get "#{url}",
85
79
  headers: headers,
86
80
  query: query,
@@ -88,7 +82,7 @@ module Football
88
82
  end
89
83
 
90
84
  def invalid_config?
91
- Configuration.api_token.blank? || Configuration.api_endpoint.blank?
85
+ Configuration.api_token.blank? || !Configuration.api_name_valid?(Configuration.api_name)
92
86
  end
93
87
 
94
88
  def log(text)
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Football
4
+ module Butler
5
+ module ApiFootball
6
+ class BaseApiFootball < Base
7
+
8
+ # class << self
9
+ # def build_path(action)
10
+ # "action=#{action}"
11
+ # end
12
+ # end
13
+
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+ require 'football/butler/api_football/base_api_football'
3
+
4
+ module Football
5
+ module Butler
6
+ module ApiFootball
7
+ class Coachs < BaseApiFootball
8
+ PATH = :coachs
9
+
10
+ class << self
11
+ ## COACHS
12
+ #
13
+ # id
14
+ # integer
15
+ # The id of the coach
16
+ #
17
+ # team
18
+ # integer
19
+ # The id of the team
20
+ #
21
+ # search
22
+ # string >= 3 characters
23
+ # The name of the coach
24
+ #
25
+ # /coachs?id={id}
26
+ def by_id(id:, result:, filters:)
27
+ filters.merge!({ id: id })
28
+ Api.get(path: PATH, result: result, filters: filters)
29
+ end
30
+
31
+ # /coachs?search={name}
32
+ def search_by_name(name:, result:, filters:)
33
+ filters.merge!({ search: name })
34
+ Api.get(path: PATH, result: result, filters: filters)
35
+ end
36
+
37
+ # /coachs?team={team}
38
+ def by_team(team:, result:, filters:)
39
+ filters.merge!({ team: team })
40
+ Api.get(path: PATH, result: result, filters: filters)
41
+ end
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+ require 'football/butler/api_football/base_api_football'
3
+
4
+ module Football
5
+ module Butler
6
+ module ApiFootball
7
+ class Countries < BaseApiFootball
8
+ PATH = :countries
9
+
10
+ class << self
11
+ ## COUNTRY
12
+ # /countries?name={name}
13
+ def by_name(name:, result:, filters:)
14
+ filters.merge!({ name: name })
15
+ Api.get(path: PATH, result: result, filters: filters)
16
+ end
17
+
18
+ # /countries?code={code}
19
+ def by_code(code:, result:, filters:)
20
+ filters.merge!({ code: code })
21
+ Api.get(path: PATH, result: result, filters: filters)
22
+ end
23
+
24
+ ## COUNTRIES
25
+ # /countries
26
+ def all(result:)
27
+ Api.get(path: PATH, result: result)
28
+ end
29
+
30
+ # /countries?search={name}
31
+ def search_by_name(name:, result:, filters:)
32
+ filters.merge!({ search: name })
33
+ Api.get(path: PATH, result: result, filters: filters)
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,80 @@
1
+ # frozen_string_literal: true
2
+ require 'football/butler/api_football/base_api_football'
3
+
4
+ module Football
5
+ module Butler
6
+ module ApiFootball
7
+ class Fixtures < BaseApiFootball
8
+ PATH = :fixtures
9
+
10
+ class << self
11
+ ## FIXTURE
12
+ # /fixtures?id={id}
13
+ def by_id(id:)
14
+ filters = { id: id }
15
+ Api.get(path: PATH, filters: filters, result: :response)
16
+ end
17
+
18
+ ## FIXTURES
19
+ #
20
+ # id
21
+ # integer
22
+ # The id of the fixture
23
+ #
24
+ # live
25
+ # string
26
+ # Enum: "all" "id-id"
27
+ # date
28
+ # stringYYYY-MM-DD
29
+ # A valid date
30
+ #
31
+ # league
32
+ # integer
33
+ # The id of the league
34
+ #
35
+ # season
36
+ # integer 4 characters YYYY
37
+ # The season of the league
38
+ #
39
+ # team
40
+ # integer
41
+ # The id of the team
42
+ #
43
+ # last
44
+ # integer <= 2 characters
45
+ # For the X last fixtures
46
+ #
47
+ # next
48
+ # integer <= 2 characters
49
+ # For the X next fixtures
50
+ #
51
+ # from
52
+ # stringYYYY-MM-DD
53
+ # A valid date
54
+ #
55
+ # to
56
+ # stringYYYY-MM-DD
57
+ # A valid date
58
+ #
59
+ # round
60
+ # string
61
+ # The round of the fixture
62
+ #
63
+ # status
64
+ # string
65
+ # The status short of the fixture
66
+ #
67
+ # timezone
68
+ # string
69
+ # A valid timezone from the endpoint Timezone
70
+ #
71
+ # /fixtures?league={id}&season={year}
72
+ def by_competition_and_year(id:, year:, result:, filters:)
73
+ filters.merge!({ league: id, season: year })
74
+ Api.get(path: PATH, filters: filters, result: result)
75
+ end
76
+ end
77
+ end
78
+ end
79
+ end
80
+ end
@@ -0,0 +1,56 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Football
4
+ module Butler
5
+ module ApiFootball
6
+ class HeadToHead < Base
7
+ PATH = 'fixtures/headtohead'
8
+
9
+ class << self
10
+ ## HEAD TO HEAD
11
+ #
12
+ # h2h
13
+ # required
14
+ # stringID-ID
15
+ # The ids of the teams
16
+ #
17
+ # date
18
+ # stringYYYY-MM-DD
19
+ # league
20
+ # integer
21
+ # The id of the league
22
+ #
23
+ # season
24
+ # integer 4 characters YYYY
25
+ # The season of the league
26
+ #
27
+ # last
28
+ # integer
29
+ # For the X last fixtures
30
+ #
31
+ # next
32
+ # integer
33
+ # For the X next fixtures
34
+ #
35
+ # from
36
+ # stringYYYY-MM-DD
37
+ # to
38
+ # stringYYYY-MM-DD
39
+ # status
40
+ # string
41
+ # The status short of the fixture
42
+ #
43
+ # timezone
44
+ # string
45
+ # A valid timezone from the endpoint Timezone
46
+ #
47
+ # fixtures/headtohead?h2h={team_id-second_team_id}
48
+ def by_teams(team_id:, second_team_id:, filters:, result:)
49
+ filters.merge!(h2h: "#{team_id}-#{second_team_id}")
50
+ Api.get(path: PATH, filters: filters, result: result)
51
+ end
52
+ end
53
+ end
54
+ end
55
+ end
56
+ end
@@ -0,0 +1,62 @@
1
+ # frozen_string_literal: true
2
+ require 'football/butler/api_football/base_api_football'
3
+
4
+ module Football
5
+ module Butler
6
+ module ApiFootball
7
+ class Injuries < BaseApiFootball
8
+ PATH = :injuries
9
+
10
+ class << self
11
+ ## Injuries
12
+ #
13
+ # league
14
+ # integer
15
+ # The id of the league
16
+ #
17
+ # season
18
+ # integer 4 characters YYYY
19
+ # The season of the league, required with league, team and player parameters
20
+ #
21
+ # fixture
22
+ # integer
23
+ # The id of the fixture
24
+ #
25
+ # team
26
+ # integer
27
+ # The id of the team
28
+ #
29
+ # player
30
+ # integer
31
+ # The id of the player
32
+ #
33
+ # date
34
+ # stringYYYY-MM-DD
35
+ # A valid date
36
+ #
37
+ # timezone
38
+ # string
39
+ # A valid timezone from the endpoint Timezone
40
+ #
41
+ # /injuries?ccompetition={competition}&season={season}
42
+ def by_competition_and_season(competition:, season:, result:, filters:)
43
+ filters.merge!({ league: competition, season: season })
44
+ Api.get(path: PATH, result: result, filters: filters)
45
+ end
46
+
47
+ # /injuries?fixture={match}
48
+ def by_match(match:, result:, filters:)
49
+ filters.merge!({ fixture: match })
50
+ Api.get(path: PATH, result: result, filters: filters)
51
+ end
52
+
53
+ # /injuries?team={team}&season={season}
54
+ def by_team_and_season(team:, season:, result:, filters:)
55
+ filters.merge!({ team: team, season: season })
56
+ Api.get(path: PATH, result: result, filters: filters)
57
+ end
58
+ end
59
+ end
60
+ end
61
+ end
62
+ end
@@ -0,0 +1,101 @@
1
+ # frozen_string_literal: true
2
+ require 'football/butler/api_football/base_api_football'
3
+
4
+ module Football
5
+ module Butler
6
+ module ApiFootball
7
+ class Leagues < BaseApiFootball
8
+ PATH = :leagues
9
+
10
+ class << self
11
+ ## LEAGUE
12
+ # /leagues?id={id}
13
+ def by_id(id:)
14
+ filters = { id: id }
15
+ Api.get(path: PATH, filters: filters, result: :response)
16
+ end
17
+
18
+ # /leagues?country={country}
19
+ def by_country_name(name:, result:)
20
+ filters = { country: name }
21
+ Api.get(path: PATH, filters: filters, result: result)
22
+ end
23
+
24
+ # /leagues/seasons
25
+ def all_seasons(result:)
26
+ path = "#{PATH}/seasons"
27
+ Api.get(path: path, result: result)
28
+ end
29
+
30
+ ## LEAGUES
31
+ # https://www.api-football.com/documentation-v3#operation/get-leagues
32
+ #
33
+ # id
34
+ # integer
35
+ # The id of the league
36
+ #
37
+ # name
38
+ # string
39
+ # The name of the league
40
+ #
41
+ # country
42
+ # string
43
+ # The country name of the league
44
+ #
45
+ # code
46
+ # string 2 characters FR, GB, IT…
47
+ # The Alpha2 code of the country
48
+ #
49
+ # season
50
+ # integer 4 characters YYYY
51
+ # The season of the league
52
+ #
53
+ # team
54
+ # integer
55
+ # The id of the team
56
+ #
57
+ # type
58
+ # string
59
+ # Enum: "league" "cup"
60
+ # The type of the league
61
+ #
62
+ # current
63
+ # string
64
+ # Enum: "true" "false"
65
+ # The state of the league
66
+ #
67
+ # search
68
+ # string >= 3 characters
69
+ # The name or the country of the league
70
+ #
71
+ # last
72
+ # integer <= 2 characters
73
+ #
74
+ # /leagues
75
+ def all(result:, filters:)
76
+ Api.get(path: PATH, result: result, filters: filters)
77
+ end
78
+
79
+ # /leagues?search={name}
80
+ def search_by_name(name:, filters:, result:)
81
+ filters.merge!({ search: name })
82
+ Api.get(path: PATH, filters: filters, result: result)
83
+ end
84
+
85
+ # /leagues?type=league
86
+ def all_leagues(result:, filters:)
87
+ filters.merge!({ type: 'league' })
88
+ Api.get(path: PATH, result: result, filters: filters)
89
+ end
90
+
91
+ # /leagues?type=cup
92
+ def all_cups(result:, filters:)
93
+ filters.merge!({ type: 'cup' })
94
+ Api.get(path: PATH, result: result, filters: filters)
95
+ end
96
+ end
97
+
98
+ end
99
+ end
100
+ end
101
+ end
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+ require 'football/butler/api_football/base_api_football'
3
+
4
+ module Football
5
+ module Butler
6
+ module ApiFootball
7
+ class Lineups < BaseApiFootball
8
+ PATH = 'fixtures/lineups'
9
+
10
+ class << self
11
+ ## LINEUPS
12
+ #
13
+ # fixture
14
+ # required
15
+ # integer
16
+ # The id of the fixture
17
+ #
18
+ # team
19
+ # integer
20
+ # The id of the team
21
+ #
22
+ # player
23
+ # integer
24
+ # The id of the player
25
+ #
26
+ # type
27
+ # string
28
+ # The type
29
+ #
30
+ # fixtures/lineups?fixture={id}
31
+ def by_match(id:)
32
+ filters = { fixture: id }
33
+ Api.get(path: PATH, filters: filters, result: :response)
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,55 @@
1
+ # frozen_string_literal: true
2
+ require 'football/butler/api_football/base_api_football'
3
+
4
+ module Football
5
+ module Butler
6
+ module ApiFootball
7
+ class Odds < BaseApiFootball
8
+ PATH = :odds
9
+
10
+ class << self
11
+ ## ODDS
12
+ #
13
+ # fixture
14
+ # integer
15
+ # The id of the fixture
16
+ #
17
+ # league
18
+ # integer
19
+ # The id of the league
20
+ #
21
+ # season
22
+ # integer 4 characters YYYY
23
+ # The season of the league
24
+ #
25
+ # date
26
+ # stringYYYY-MM-DD
27
+ # A valid date
28
+ #
29
+ # timezone
30
+ # string
31
+ # A valid timezone from the endpoint Timezone
32
+ #
33
+ # page
34
+ # integer
35
+ # Default: 1
36
+ # Use for the pagination
37
+ #
38
+ # bookmaker
39
+ # integer
40
+ # The id of the bookmaker
41
+ #
42
+ # bet
43
+ # integer
44
+ # The id of the bet
45
+ #
46
+ # odds&match_id={id}&from={from}&to={to}
47
+ def by_match(id:, from:, to:, result:)
48
+ filters = { fixture: id }
49
+ Api.get(path: PATH, filters: filters, result: result)
50
+ end
51
+ end
52
+ end
53
+ end
54
+ end
55
+ end
@@ -0,0 +1,47 @@
1
+ # frozen_string_literal: true
2
+ require 'football/butler/api_football/base_api_football'
3
+
4
+ module Football
5
+ module Butler
6
+ module ApiFootball
7
+ class Players < BaseApiFootball
8
+ PATH = :players
9
+
10
+ class << self
11
+ ## PLAYER
12
+ #
13
+ # id
14
+ # integer
15
+ # The id of the player
16
+ #
17
+ # team
18
+ # integer
19
+ # The id of the team
20
+ #
21
+ # league
22
+ # integer
23
+ # The id of the league
24
+ #
25
+ # season
26
+ # integer 4 characters YYYY | Requires the fields Id, League or Team...
27
+ # The season of the league
28
+ #
29
+ # search
30
+ # string >= 4 characters Requires the fields League or Team
31
+ # The name of the player
32
+ #
33
+ # page
34
+ # integer
35
+ # Default: 1
36
+ # Use for the pagination
37
+ #
38
+ # players?id={id}&season={season}
39
+ def by_id_and_season(id:, season:, result:, filters:)
40
+ filters.merge!({ id: id, season: season })
41
+ Api.get(path: PATH, filters: filters, result: result)
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+ require 'football/butler/api_football/base_api_football'
3
+
4
+ module Football
5
+ module Butler
6
+ module ApiFootball
7
+ class Predictions < BaseApiFootball
8
+ PATH = :predictions
9
+
10
+ class << self
11
+ ## PREDICTIONS
12
+ #
13
+ # fixture
14
+ # required
15
+ # integer
16
+ # The id of the fixture
17
+ #
18
+ # predictions&fixture={id}
19
+ def by_match(id:, filters:, result:)
20
+ filters.merge!(fixture: id)
21
+ Api.get(path: PATH, filters: filters, result: result)
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+ require 'football/butler/api_football/base_api_football'
3
+
4
+ module Football
5
+ module Butler
6
+ module ApiFootball
7
+ class Sidelineds < BaseApiFootball
8
+ PATH = :sidelined
9
+
10
+ class << self
11
+ ## SIDELINED
12
+ #
13
+ # player
14
+ # integer
15
+ # The id of the player
16
+ #
17
+ # coach
18
+ # integer
19
+ # The id of the coach
20
+ #
21
+ # /trophies?player={player}
22
+ def by_player(player:, result:, filters:)
23
+ filters.merge!({ player: player })
24
+ Api.get(path: PATH, filters: filters, result: result)
25
+ end
26
+
27
+ # /trophies?coach={coach}
28
+ def by_coach(coach:, result:, filters:)
29
+ filters.merge!({ coach: coach })
30
+ Api.get(path: PATH, filters: filters, result: result)
31
+ end
32
+
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end