def use_command_class(slack_event, params, target_class): channel = Misc.get_value(slack_event, 'channel') user = Misc.get_value(slack_event, 'user') Slack_Commands_Helper(target_class).invoke(team_id=user, channel=channel, params=params) return None, None
def hello(slack_event=None, params=None): user = Misc.get_value(slack_event, 'user') return 'Hello <@{0}>, how can I help you?'.format(user), []
def value_secret(self): return Misc.get_value(self.get_secret(),'Value')
def project_info(self): projects = Misc.get_value(self.codebuild.batch_get_projects(names=[self.project_name]),'projects',[]) return Misc.array_pop(projects,0)
def role_arn(self): return Misc.get_value(self.role_info(), 'Arn')
def resolve_command_shortcuts(self, method_name): return Misc.get_value(self.method_shortcuts, method_name, method_name)
def run(event, context): return "Hello {0} (from lambda)".format(Misc.get_value(event,'name','_'))
def stream_arn(self): streams = self.dynamo.dynamo_streams().list_streams( TableName=self.table_name).get('Streams') first_one = Misc.array_pop(streams, 0) return Misc.get_value(first_one, 'StreamArn')