Exemplo n.º 1
0
def get_preview_messages(team_id):
    logger.info(
        f"Attempting to get all preview messages for user from team #{team_id}."
    )
    req = ClientRequest(request)
    messages = MessageService.get_preview_messages(
        req.team_authentication_data(team_id))
    return jsonify(messages.json()), messages.status_code()
Exemplo n.º 2
0
def get_team_bots(team_id):
    logger.info(f"Attempting to get team #{team_id}'s bots.")
    req = ClientRequest(request)
    response = BotService.team_bots(req.team_authentication_data(team_id))
    return jsonify(response.json()), response.status_code()
Exemplo n.º 3
0
def team_channels(team_id):
    logger.info(f"Attempting to get all channels from team #{team_id}.")
    req = ClientRequest(request)
    channels = TeamService.team_channels(req.team_authentication_data(team_id))
    return jsonify(channels.json()), channels.status_code()
Exemplo n.º 4
0
def team_users(team_id):
    logger.info(f"Attempting to get all users from team #{team_id}.")
    req = ClientRequest(request)
    users = TeamService.team_users(req.team_authentication_data(team_id))
    return jsonify(users.json()), users.status_code()
Exemplo n.º 5
0
def forbidden_words(team_id):
    logger.info(f"Attempting to get forbidden words from team {team_id}.")
    req = ClientRequest(request)
    words = TeamService.forbidden_words(req.team_authentication_data(team_id))
    return jsonify(words.json()), words.status_code()
Exemplo n.º 6
0
def delete_team(team_id):
    logger.info(f"Attempting to delete team #{team_id}.")
    req = ClientRequest(request)
    response = TeamService.delete_team(req.team_authentication_data(team_id))
    return jsonify(response.json()), response.status_code()
Exemplo n.º 7
0
 def test_team_authentication_data_with_authentication_header_works_properly(
         self):
     input_request = Request(headers=authentication_headers)
     client_request = ClientRequest(input_request)
     self.assertIsInstance(client_request.team_authentication_data(mock),
                           TeamAuthenticationDTO)