Skip to content
Ilya Krukowski edited this page Nov 18, 2022 · 2 revisions

Teams endpoint, supports pagination.

Fetch teams

Providing pagination data and search params is optional:

teams = client.teams itemsPerPage: 2, name: 'Н', page: 3
teams[0].id # => 11

Fetch a single team

Provide team ID:

team = client.team 2
team.name # => 'Афина'

Fetch team seasons

seasons = client.team_seasons 2, idseason: 9
seasons.first.idseason # => 9

Alternatively:

team = client.team 2
seasons = team.seasons
seasons.first.idseason # => 9

Fetch team tournaments

tournaments = client.team_tournaments 2, pagination: true
tournaments[2].idtournament # => 8

Alternatively:

team = client.team 2
tournaments = team.tournaments pagination: true
tournaments[2].idtournament # => 8

Create team

team = client.create_team name: 'Команда А'
team.name # => 'Команда А'

Update team

client.update_team 1, name: 'Команда 1'

Alternatively:

team = client.team 2
team.update name: 'Команда 1'

Delete team

client.delete_team 1

Alternatively:

team = client.team 2
team.destroy
Clone this wiki locally