From d10a7d40fe70a6e485cc76481340850ebcbca3dd Mon Sep 17 00:00:00 2001 From: Ace Nassri Date: Fri, 13 May 2022 12:37:29 -0700 Subject: [PATCH] feat(functions/slack): add GCF v2 decorators (#7889) * feat(functions/slack): add GCF v2 decorators * Fix lint * Fix copyright * Bots hate commas * Humans hate commas too * Fix copyright Co-authored-by: Dan Lee <71398022+dandhlee@users.noreply.github.com> Co-authored-by: Dan Lee <71398022+dandhlee@users.noreply.github.com> --- functions/slack/main.py | 4 +++- functions/slack/requirements.txt | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/functions/slack/main.py b/functions/slack/main.py index 47f3ef037aff..31f50ea9ee79 100644 --- a/functions/slack/main.py +++ b/functions/slack/main.py @@ -1,4 +1,4 @@ -# Copyright 2018, Google, LLC. +# Copyright 2018 Google LLC. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -15,6 +15,7 @@ import os from flask import jsonify +import functions_framework import googleapiclient.discovery from slack.signature import SignatureVerifier @@ -89,6 +90,7 @@ def make_search_request(query): # [START functions_slack_search] +@functions_framework.http def kg_search(request): if request.method != 'POST': return 'Only POST requests are accepted', 405 diff --git a/functions/slack/requirements.txt b/functions/slack/requirements.txt index 94ee178e30fa..08c9316f9288 100644 --- a/functions/slack/requirements.txt +++ b/functions/slack/requirements.txt @@ -1,3 +1,4 @@ google-api-python-client==2.41.0 flask==2.1.0 +functions-framework==3.0.0 slackclient==2.9.4