async def post(self, request, args): """ Selects map. """ return Responder( await request.state.league.match( match_id=args["match_id"] ).select.map( map_id=args["map"] ) ).ujson()
async def post(self, request, args): """ Selects player for team. """ return Responder( await request.state.league.match( match_id=args["match_id"] ).select.player( user_id=args["user_id"] ) ).ujson()
async def patch(self, request, args): """ Reset user. """ return Responder(await request.state.league.player(**args).reset()).ujson()
async def delete(self, request, args): """ Delete user. """ return Responder(await request.state.league.player(**args).delete()).ujson()
async def get(self, request, args): """ Get user. """ return Responder(await request.state.league.player(**args).get()).json()
def invalid_region(): """ Handles invalid regions """ return Responder(Response(error="Invalid Region", status=500)).ujson()
async def post(self, request, args): """ Updates league details. """ return Responder(await request.state.league.update(**args)).ujson()
async def arg_expection(request, exc): return Responder(Response(error=exc.messages, status=exc.status_code)).ujson()
async def get(self, request, args): """ List players. """ return Responder(await request.state.league.list(**args).players()).json()
async def get(self, request, args): """ Gets base details of match. """ return Responder( await request.state.league.match(**args).get() ).json()
async def delete(self, request, args): """ Deletes match. """ return Responder( await request.state.league.match(**args).end() ).json()
async def post(self, request, args): """ Creates match. """ return Responder( await request.state.league.match().create(**args) ).json()
async def get(self, request): """ Pulls details of map. """ return Responder(await request.state.league.details()).ujson()
async def post(self, request, args): return Responder(await request.state.league.players(**args ).validate()).ujson()
async def get(self, request, args): """ Gets scoreboard of match. """ return Responder( await request.state.league.match(**args).scoreboard() ).json()
async def get(self, request, args): """ List info about given players. """ return Responder(await request.state.league.players( user_ids=args["user_ids"] ).fetch(include_stats=args["include_stats"])).ujson()
async def post(self, request, args): """ Clones match. """ return Responder( await request.state.league.match(**args).clone() ).json()
async def get(self, request, args): """ Gets list of matches. """ return Responder(await request.state.league.list(**args).matches()).json()
def unauthorized(): """ Handles unauthorized requests """ return Responder(Response(error="Unauthorized", status=401)).ujson()
async def http_exception(request, exc): return Responder(Response(error=exc.detail, status=exc.status_code)).ujson()
async def post(self, request, args): """ Get user. """ return Responder(await modulelift.CLIENT.user().create(**args)).json()