Skip to content

Instantly share code, notes, and snippets.

@jtwaleson
Last active November 27, 2022 14:08
Show Gist options
  • Save jtwaleson/aa981b3095bb47c1e8ac698117cc572a to your computer and use it in GitHub Desktop.
Save jtwaleson/aa981b3095bb47c1e8ac698117cc572a to your computer and use it in GitHub Desktop.
Other hints than type hints
@intent("API wrapper method to send a single message to a single slack channel")
@allowed_users(roles=[roles.ADMIN, roles.END_USER])
@data_protection(possible_pii="attr:message")
@side_effects(has_side_effect=side_effects.EXTERNAL_API)
@memory(should_use_kb=10)
@speed(should_run_in_ms=1000)
@tests([post_message_to_slack_ultra_large_message_should_fail, post_message_to_slack_should_succeed])
def post_message_to_slack(channel: SlackChannel, message: SlackMessage):
requests.post("https://api.slack.com", message)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment