Source code for mattermostdriver.endpoints.commands

from .base import Base
from .teams import Teams


[docs]class Commands(Base): endpoint = '/commands'
[docs] def create_command(self, options=None): return self.client.post( self.endpoint, options=options )
[docs] def list_commands_for_team(self, params=None): return self.client.get( self.endpoint, params=params )
[docs] def list_autocomplete_commands(self, team_id): return self.client.get( Teams.endpoint + team_id + '/commands/autocomplete' )
[docs] def update_command(self, command_id, options=None): return self.client.put( self.endpoint + command_id, options=options )
[docs] def delete_command(self, command_id): return self.client.delete( self.endpoint + command_id )
[docs] def generate_new_token(self, command_id): return self.client.put( self.endpoint + command_id + '/regen_token' )
[docs] def execute_command(self, options=None): return self.client.post( self.endpoint + '/execute', options=options )